feat: Configure l2geth Docker pipeline to push latest tag (#831)

* 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
This commit is contained in:
Nazarii Denha 2024-07-03 21:47:55 +02:00 committed by GitHub
parent 4e8468fdb7
commit e30e1f16fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,8 @@ on:
push: push:
tags: tags:
- '*' - '*'
release:
types: [published]
jobs: jobs:
build-and-push: build-and-push:
@ -15,6 +17,16 @@ jobs:
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 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 - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
@ -27,6 +39,7 @@ jobs:
file: Dockerfile file: Dockerfile
# push: ${{ startsWith(github.ref, 'refs/tags/') }} # push: ${{ startsWith(github.ref, 'refs/tags/') }}
push: true 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-from: type=gha,scope=${{ github.workflow }}
# cache-to: type=gha,scope=${{ github.workflow }} # cache-to: type=gha,scope=${{ github.workflow }}