Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove builder instances after build #76

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ on:
- 'docker-bake.hcl'
- '.github/workflows/CI.yml'
workflow_dispatch:
inputs:
tag:
description: 'which tag need to publish'
default: ''
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
build:
strategy:
matrix:
target: [ "all", "18", "17", "16", "16-alpine", "15", "14", "13", "12", "11", "10", "9", "8", "7"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -42,18 +45,14 @@ jobs:
- name: Check buildx bake
run: docker buildx bake --file docker-bake.hcl --print

- name: Build all images
if: github.ref == 'refs/heads/master' && github.event.inputs.tag == ''
run: docker buildx bake --file docker-bake.hcl --load

- name: Publish an image for tag ${{ inputs.tag }}
if: github.ref == 'refs/heads/master' && github.event.inputs.tag != ''
run: docker buildx bake --file docker-bake.hcl ${{ inputs.tag }} --load
- name: Build image for tag ${{ matrix.target }}
if: github.ref == 'refs/heads/master'
run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --load

- name: Publish all images
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && github.event.inputs.tag == ''
run: docker buildx bake --file docker-bake.hcl --push
- name: Publish image for tag ${{ matrix.target }}
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
run: docker buildx bake --file docker-bake.hcl ${{ matrix.target }} --push

- name: Publish an image for tag ${{ inputs.tag }}
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch' && github.event.inputs.tag != ''
run: docker buildx bake --file docker-bake.hcl ${{ inputs.tag }} --push
- name: Remove builder instances
if: github.ref == 'refs/heads/master' && github.event_name == 'workflow_dispatch'
run: docker buildx rm --all-inactive --force