From ecbbfad3d721753154a3ffef717f109f9f42445a Mon Sep 17 00:00:00 2001 From: Marek Skrobacki Date: Tue, 6 Aug 2024 17:18:52 +0100 Subject: [PATCH] chore: enable container builds on more events For testing allow us to build the containers. Allow workflow_dispatch to rebuild the containers. Always push the container when running a PR. --- .github/workflows/containers.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/containers.yaml b/.github/workflows/containers.yaml index 35633394d..a91f495e7 100644 --- a/.github/workflows/containers.yaml +++ b/.github/workflows/containers.yaml @@ -82,8 +82,10 @@ jobs: with: images: ghcr.io/rackerlabs/understack/dnsmasq tags: | - type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=latest,enable={{ is_default_branch }} + type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }} type=sha,enable={{is_default_branch}} + type=ref,event=branch labels: | org.opencontainers.image.title=dnsmasq for Understack's Ironic env: @@ -116,7 +118,6 @@ jobs: - name: setup docker buildx uses: docker/setup-buildx-action@v3 - name: login to ghcr.io - if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 with: registry: ghcr.io @@ -130,8 +131,10 @@ jobs: images: ghcr.io/rackerlabs/understack/${{ matrix.container.name }} tags: | type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }} type=ref,event=tag type=ref,event=pr + type=ref,event=branch labels: | org.opencontainers.image.title=${{ matrix.container.title }} env: @@ -147,7 +150,7 @@ jobs: with: file: containers/Dockerfile.${{ matrix.container.name }} pull: true # ensure we always have an up to date source - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }}