Skip to content

ci: prevent pushing unknown architecture image (#7) #2

ci: prevent pushing unknown architecture image (#7)

ci: prevent pushing unknown architecture image (#7) #2

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: Release
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
id: buildx
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: output docker build args
id: args
run: |
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
echo "revision=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
- name: output semver tags
id: tags
run: |
echo "major=$(echo ${{ github.ref_name }} | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "minor=$(echo ${{ github.ref_name }} | cut -d. -f1,2)" >> $GITHUB_OUTPUT
- uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
provenance: false
push: true
tags: |
ghcr.io/joshdk/actions-docker-shim:latest
ghcr.io/joshdk/actions-docker-shim:${{ github.ref_name }}
ghcr.io/joshdk/actions-docker-shim:${{ steps.tags.outputs.minor }}
ghcr.io/joshdk/actions-docker-shim:${{ steps.tags.outputs.major }}
build-args: |
CREATED=${{ steps.args.outputs.created }}
REVISION=${{ steps.args.outputs.revision }}
VERSION=${{ steps.args.outputs.version }}