Skip to content

Commit

Permalink
Update tag convention for docker images (#2566)
Browse files Browse the repository at this point in the history
* Update tag convention for docker images

* change default input flavor behavior

* [skip ci] ooops

* [skip ci] fix typo
  • Loading branch information
tom2drum authored Feb 10, 2025
1 parent 6de407d commit 26aaca3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ jobs:
name: Publish Docker image
uses: './.github/workflows/publish-image.yml'
secrets: inherit
with:
tags: |
type=ref,event=branch
type=raw,value=unstable
3 changes: 2 additions & 1 deletion .github/workflows/deploy-review-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ jobs:
needs: make_slug
uses: './.github/workflows/publish-image.yml'
with:
tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }}
tags: |
type=raw,value=review-${{ needs.make_slug.outputs.REF_SLUG }}
build_args: ENVS_PRESET=${{ inputs.envs_preset }}
secrets: inherit

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ jobs:
needs: make_slug
uses: './.github/workflows/publish-image.yml'
with:
tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }}
tags: |
type=raw,value=review-${{ needs.make_slug.outputs.REF_SLUG }}
build_args: ENVS_PRESET=${{ inputs.envs_preset }}
secrets: inherit

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
name: Publish Docker image
uses: './.github/workflows/publish-image.yml'
secrets: inherit
with:
# FIXME: e2e tests has default docker image tag "main" - https://github.com/blockscout/blockscout-ci-cd/blob/56a5424cfa07b03ca378e04650c4c67650ec40a0/charts/blockscout-stack/values/e2e/values.yaml#L352
# NOTE: by default the image will be built with type=ref,event=tag; so we don't need to specify it here
tags: |
type=raw,value=main
type=ref,event=branch
deploy_e2e:
name: Deploy E2E instance
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
tags:
description: Image tags
description: Image tags (e.g. "type=raw,value=foo")
required: false
type: string
build_args:
Expand All @@ -19,7 +19,7 @@ on:
workflow_call:
inputs:
tags:
description: Image tags
description: Image tags (e.g. "type=raw,value=foo")
required: false
type: string
build_args:
Expand Down Expand Up @@ -49,6 +49,11 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/blockscout/frontend
flavor: |
latest=false
tags: |
type=ref,event=tag
${{ inputs.tags }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -75,7 +80,7 @@ jobs:
file: ./Dockerfile
push: true
cache-from: type=gha
tags: ${{ inputs.tags || steps.meta.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ inputs.platforms }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ jobs:
secrets: inherit
with:
platforms: linux/amd64,linux/arm64/v8
# NOTE: by default the image will be built with type=ref,event=tag; so we need to specify it here
tags: |
type=raw,value=latest
sync_envs_docs:
name: Sync ENV variables docs
Expand Down

0 comments on commit 26aaca3

Please sign in to comment.