Skip to content

My varible

My varible #49

Workflow file for this run

name: Build Docker Image - CI
on:
release:
types:
- published
push:
branches:
- main
- master
- 'release-\d.\d\d'
env:
MY_VAR: ${{ github.event_name == 'push' && 'myvar' || github.ref_name }}
jobs:
build:
name: Build and push docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract branch name
shell: bash
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 }}"
# uses: docker/setup-qemu-action@v3