From 0f6471eaa2d463a64c8ce8e215a372d32fa0c959 Mon Sep 17 00:00:00 2001 From: Tibo Beijen Date: Wed, 24 Jul 2024 06:36:25 +0200 Subject: [PATCH] Added tag parsing & checkout --- .github/workflows/main.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7655da8..81e76bd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -69,5 +69,26 @@ jobs: needs: - build steps: - - name: Test docker tags - run: echo "docker_image_tags = ${{ needs.build.outputs.docker_image_tags }}" + - name: Extract sha tag + id: extract-sha-tag + run: | + tags="${{ needs.build.outputs.docker_image_tags }}"" + echo "Docker image tags:" + echo "$tags" + sha_tag=$(echo "$tags" | grep -oE 'ghcr.io/[^:]+:sha-[^ ]+') + if [ -z "$sha_tag" ]; then + echo "No tag starting with 'sha-' found." + exit 1 + else + echo "Extracted sha- tag: $sha_tag" + echo "::set-output name=sha_tag::$sha_tag" + fi + + - name: GitOps Checkout + uses: actions/checkout@v4 + with: + repository: tbeijen/tbnl-www-gitops + ref: main + token: ${{ secrets.TBNL_BOT_PAT }} + fetch-depth: 0 + path: tbnl-www-gitops