Skip to content

feat(ci): update Docker and release workflows for improved version ha… #5

feat(ci): update Docker and release workflows for improved version ha…

feat(ci): update Docker and release workflows for improved version ha… #5

Workflow file for this run

name: Build and Push Docker Image
# NOTE: This workflow is intended to be run manually (via workflow_dispatch)
# or called by other workflows (via workflow_call). It no longer triggers
# automatically on push or tag events — use the `release.yml` workflow to
# invoke this workflow as part of the release pipeline.
on:
workflow_dispatch:
workflow_call:
inputs:
LAZYDNS_VERSION:
required: false
type: string
secrets:
DOCKERHUB_TOKEN:
required: true
DOCKERHUB_USERNAME:
required: true
GITHUB_TOKEN:

Check failure on line 20 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
lazywalker/lazydns
ghcr.io/${{ github.repository_owner }}/lazydns
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
LAZYDNS_VERSION=${{ inputs.LAZYDNS_VERSION || (startsWith(github.ref, 'refs/tags/') && github.ref_name) || 'latest' }}