Skip to content

Commit

Permalink
fix: push 'latest' image from latest 'use' image
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Mar 12, 2024
1 parent 46d4f92 commit c340b98
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,33 @@ jobs:

# Push the images if the tests pass and this is not a PR
- name: Push proposal "use" images
uses: depot/bake-action@v1
# If we pushed from PRs, each one would overwrite main's (e.g. use-upgrade-8)
# To push PR "use" images we'll need to qualify the tag (e.g. use-upgrade-8-pr-2).
if: ${{ github.event_name != 'pull_request' }}
uses: depot/bake-action@v1
with:
files: |
./docker-bake.json
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: use
push: true

# Just like the "use" image above but has to begin after that ends
# because the "build" here is merely to retag the latest "use" image.
# We could do this with imagetools but this lets use keep the tagging logic
# in Bake instead of mixed into CI. This step should do hardly any building
# because its FROM image was just built above.
- name: Push "latest" image
# Same reason as for "use" images
if: ${{ github.event_name != 'pull_request' }}
uses: depot/bake-action@v1
with:
files: |
./docker-bake.json
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
# Include "latest" which is latest "use" image
targets: use, latest
targets: latest
push: true

- name: notify on failure
Expand Down

0 comments on commit c340b98

Please sign in to comment.