spike: switch auth method, and run workflow on push to branch #2
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: Publish Test Docker image | |
on: | |
push: | |
branches: | |
- spike/CLOUD-2464_multi-arch-iac-image | |
jobs: | |
push_to_registry: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract Tags | |
id: tags | |
run: | | |
IMAGE_VERSION="test" | |
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.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- 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 }} | |