Commit 26aaca38 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Update tag convention for docker images (#2566)

* Update tag convention for docker images

* change default input flavor behavior

* [skip ci] ooops

* [skip ci] fix typo
parent 6de407de
...@@ -25,3 +25,7 @@ jobs: ...@@ -25,3 +25,7 @@ jobs:
name: Publish Docker image name: Publish Docker image
uses: './.github/workflows/publish-image.yml' uses: './.github/workflows/publish-image.yml'
secrets: inherit secrets: inherit
with:
tags: |
type=ref,event=branch
type=raw,value=unstable
...@@ -53,7 +53,8 @@ jobs: ...@@ -53,7 +53,8 @@ jobs:
needs: make_slug needs: make_slug
uses: './.github/workflows/publish-image.yml' uses: './.github/workflows/publish-image.yml'
with: 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 }} build_args: ENVS_PRESET=${{ inputs.envs_preset }}
secrets: inherit secrets: inherit
......
...@@ -54,7 +54,8 @@ jobs: ...@@ -54,7 +54,8 @@ jobs:
needs: make_slug needs: make_slug
uses: './.github/workflows/publish-image.yml' uses: './.github/workflows/publish-image.yml'
with: 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 }} build_args: ENVS_PRESET=${{ inputs.envs_preset }}
secrets: inherit secrets: inherit
......
...@@ -13,6 +13,12 @@ jobs: ...@@ -13,6 +13,12 @@ jobs:
name: Publish Docker image name: Publish Docker image
uses: './.github/workflows/publish-image.yml' uses: './.github/workflows/publish-image.yml'
secrets: inherit 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: deploy_e2e:
name: Deploy E2E instance name: Deploy E2E instance
......
...@@ -4,7 +4,7 @@ on: ...@@ -4,7 +4,7 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
tags: tags:
description: Image tags description: Image tags (e.g. "type=raw,value=foo")
required: false required: false
type: string type: string
build_args: build_args:
...@@ -19,7 +19,7 @@ on: ...@@ -19,7 +19,7 @@ on:
workflow_call: workflow_call:
inputs: inputs:
tags: tags:
description: Image tags description: Image tags (e.g. "type=raw,value=foo")
required: false required: false
type: string type: string
build_args: build_args:
...@@ -49,6 +49,11 @@ jobs: ...@@ -49,6 +49,11 @@ jobs:
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: ghcr.io/blockscout/frontend images: ghcr.io/blockscout/frontend
flavor: |
latest=false
tags: |
type=ref,event=tag
${{ inputs.tags }}
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
...@@ -75,7 +80,7 @@ jobs: ...@@ -75,7 +80,7 @@ jobs:
file: ./Dockerfile file: ./Dockerfile
push: true push: true
cache-from: type=gha cache-from: type=gha
tags: ${{ inputs.tags || steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
platforms: ${{ inputs.platforms }} platforms: ${{ inputs.platforms }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
......
...@@ -80,6 +80,9 @@ jobs: ...@@ -80,6 +80,9 @@ jobs:
secrets: inherit secrets: inherit
with: with:
platforms: linux/amd64,linux/arm64/v8 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: sync_envs_docs:
name: Sync ENV variables docs name: Sync ENV variables docs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment