ci: Specify commit and build time via linker flags #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
packages: write | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.2.2 | |
- uses: docker/setup-buildx-action@v3 # for cross-arch build - GH runners are AMD but VPS is ARM | |
- name: Set release version | |
# `#v` to strip the `v` prefix: v1.2.3 -> 1.2.3 | |
run: echo "RELEASE_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV | |
- name: Log in to GHCR | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image and publish to GHCR | |
uses: docker/build-push-action@v6.9.0 | |
with: | |
context: . | |
push: true | |
platforms: linux/arm64 | |
# Disable provenance to prevent multi-platform index with unused layers like `unknown/unknown` | |
# https://github.com/docker/buildx/issues/1509#issuecomment-1378538197 | |
provenance: false | |
tags: | | |
ghcr.io/ivov/n8n-shortlink:latest | |
ghcr.io/ivov/n8n-shortlink:${{ env.RELEASE_VERSION }} |