Skip to content

new

new #1

Workflow file for this run

name: Docker
on:
push:
branches: [nodekit]
tags: [v*]
pull_request:
branches: [nodekit]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Setting up Go
- uses: actions/setup-go@v4
with:
go-version: "^1.20.x" # The Go version to download (if necessary) and use.
- run: go version
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Generate correct tabs and labels
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/AnomalyFi/eth-faucet
tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=sha
# set latest tag for `nodekit` branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'nodekit') }}
- name: Build and push
uses: docker/build-push-action@v4
with:
# this gets rid of the unknown/unknown image that is created without this setting
# https://github.com/docker/build-push-action/issues/820#issuecomment-1455687416
provenance: false
context: .
platforms: ${{ (contains(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/nodekit') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}