mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 15:46:43 +00:00
* 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
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: Docker
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Set up QEMU
|
|
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:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Build docker image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
# push: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
|
# cache-to: type=gha,scope=${{ github.workflow }}
|