Skip to content

Commit

Permalink
feat: Configure l2geth Docker pipeline to push latest tag (#831)
Browse files Browse the repository at this point in the history
* push latest tag

* push latest tag on release published

* use metadata-action to define tags

* test

* push ref name on push tag or push latest tag on publishing release
  • Loading branch information
NazariiDenha authored and HAOYUatHZ committed Jul 31, 2024
1 parent 3d964d6 commit 1d949d1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- '*'
release:
types: [published]

jobs:
build-and-push:
Expand All @@ -15,6 +17,16 @@ jobs:
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: scrolltech/l2geth
tags: |
type=ref,event=tag,enable=${{ github.event_name == 'push' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
flavor: |
latest=false
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
Expand All @@ -27,6 +39,7 @@ jobs:
file: Dockerfile
# push: ${{ startsWith(github.ref, 'refs/tags/') }}
push: true
tags: scrolltech/l2geth:${{github.ref_name}}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# cache-from: type=gha,scope=${{ github.workflow }}
# cache-to: type=gha,scope=${{ github.workflow }}

0 comments on commit 1d949d1

Please sign in to comment.