Skip to content

Commit

Permalink
spike: add workflow to build multi-arch test image
Browse files Browse the repository at this point in the history
  • Loading branch information
samholdawayinshur committed May 30, 2024
1 parent 6cd6306 commit 602528c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/tag_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Test Docker image

on:
push:
tags:
- '**'

jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
- name: Extract Tags
id: tags
run: |
IMAGE_VERSION="${GITHUB_REF/refs\/tags\//}"
TAGS="ghcr.io/inshur/fy-test:$IMAGE_VERSION"
echo "IMAGE_VERSION=${IMAGE_VERSION}" >> "$GITHUB_ENV"
echo "TAGS=${TAGS}" >> "$GITHUB_ENV"
echo "$TAGS"
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
- name: Check out repo
uses: actions/[email protected]

- uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}

- name: Push to GitHub Packages
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
# failing to use a variable here for some reason:
# Error: buildx call failed with: invalid tag "${TAGS}": invalid reference format
#tags: inshur/fy:latest
tags: ${{ steps.tags.outputs.tags }}

0 comments on commit 602528c

Please sign in to comment.