From 2db891ab2028e075011e2f541127b99cb51e7a4a Mon Sep 17 00:00:00 2001 From: marhode Date: Wed, 18 Sep 2024 17:07:45 +0200 Subject: [PATCH] Added push on tag GH action --- .../moodletools-build-and-push-on-tag.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/moodletools-build-and-push-on-tag.yaml diff --git a/.github/workflows/moodletools-build-and-push-on-tag.yaml b/.github/workflows/moodletools-build-and-push-on-tag.yaml new file mode 100644 index 0000000..004d795 --- /dev/null +++ b/.github/workflows/moodletools-build-and-push-on-tag.yaml @@ -0,0 +1,33 @@ +--- +name: Build and push Docker Image on Tag + +on: + push: + tags: + - 'moodle-tools-[0-9]+.[0-9]+.[0-9]+*' +jobs: + pre_build: + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.tag }} + suffix: ${{ steps.tag.outputs.suffix }} + steps: + - name: Filter Tag name + uses: olegtarasov/get-tag@v2.1 + id: tag + with: + tagRegex: "(?[0-9]+.[0-9]+.[0-9]+)(?-.*)" + build_and_push: + permissions: + packages: write + security-events: write + actions: read + contents: read + needs: pre_build + uses: hpi-schul-cloud/infra-tools/.github/workflows/build-and-push.yaml@master + with: + registry: ghcr.io + image: dbildungsplattform/moodle-tools + tag: ${{ needs.pre_build.outputs.tag }} + image_name: "moodle-tools" + context: "./moodle-tools/"