Skip to content

One more fix

One more fix #52

Workflow file for this run

name: Build Docker Image - CI
on:
release:
types:
- published
push:
branches:
- main
- master
- 'release-\d.\d\d'
jobs:
build:
name: Build and push docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
if: contains(github.ref, 'release-')
run: |
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
version_digits=$(echo ${branch} | tr -d -c 0-9)
image_version=v$(echo ${version_digits} | cut -b 1).$(echo ${version_digits:1})
echo "image_version=${image_version}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Set up QEMU
run: |
ls -l
cat main/main.go
echo "Image pushed to ${{ steps.extract_branch.outputs.image_version }}"
echo "Variable is ${{ env.MY_VAR }}"
env:
MY_VAR: ${{ github.ref == 'ref/head/master' && 'latest' || steps.extract_branch.outputs.image_version }}
# uses: docker/setup-qemu-action@v3