New fix #51
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: 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-") | ||
Check failure on line 23 in .github/workflows/ci-file.yaml GitHub Actions / Build Docker Image - CIInvalid workflow file
|
||
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 |