Test tags version

This commit is contained in:
schooltechx 2023-03-19 15:57:25 +07:00
parent 7976dc425a
commit 3f535d14ae

40
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,40 @@
name: remote-build
run-name: remote-build ${{ github.actor }}
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
# tags-ignore:
# - '2.*'
# Allow run workflow manually from Action tab
workflow_dispatch:
inputs:
IMAGE_VER:
description: "version for build image"
type: string
env:
REGISTRY: docker.frappet.com
IMAGE_NAME: demo/qualifying-exam-cms
# IMAGE_TAG: 0.2.1
jobs:
# export GITHUB_REF=refs/tags/v1.2.3
# act workflow_dispatch --input IMAGE_VER=v0.2.1 -W .github/workflows/release.yaml -j release
release:
runs-on: ubuntu-latest
steps:
- name: Gen tags
id: gen_ver
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
IMAGE_VER='${GITHUB_REF/refs\/tags\//}'
else
IMAGE_VER=${{ github.event.inputs.IMAGE_VER }}
fi
if [[ $IMAGE_VER == '' ]]; then
IMAGE_VER='beta'
fi
echo '::set-output name=image_ver::'$IMAGE_VER
- name: Test
run: |
echo $GITHUB_REF
echo ${{ steps.gen_ver.outputs.image_ver }}