From 76f7605baf333c104b3c3a623449572edd0ee58e Mon Sep 17 00:00:00 2001 From: Olava Faksdal <38139899+olavis@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:06:38 +0100 Subject: [PATCH] ci: publish on tag --- .github/workflows/on-tag.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/on-tag.yaml diff --git a/.github/workflows/on-tag.yaml b/.github/workflows/on-tag.yaml new file mode 100644 index 00000000..51e01fd6 --- /dev/null +++ b/.github/workflows/on-tag.yaml @@ -0,0 +1,32 @@ +on: + push: + tags: + - v* + +jobs: + set-tag-ref: + name: set-tag-ref + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Create tag ref + id: create-tag-ref + run: | + TAG_REF=$(echo $GITHUB_REF | cut -d / -f 3) + echo "tag-ref=$TAG_REF" >> $GITHUB_OUTPUT + + outputs: + tag-ref: ${{ steps.create-tag-ref.outputs.tag-ref }} + + publish-prod: + uses: ./.github/workflows/publish.yaml + with: + IMAGE_TAG: production + + publish-tag: + needs: [set-tag-ref] + uses: ./.github/workflows/publish.yaml + with: + IMAGE_TAG: ${{ needs.set-tag-ref.outputs.tag-ref }} \ No newline at end of file