diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..7c4bc70 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 }}