From 041b1491559bdb2a0340ce512ab137350916d6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kluczek?= Date: Thu, 4 Apr 2024 21:58:03 +0200 Subject: [PATCH] Add production deployment workflow --- .github/workflows/deploy-prod.yml | 44 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 83db5ff185..d12a4db876 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -5,32 +5,28 @@ on: tags: - v[0-9]+.[0-9]+.[0-9]+ -env: - IMAGE_TAG: "${{ github.sha }}" - GIT_TAG: "${{ github.ref }}" - jobs: - build: - name: Build - uses: ./.github/workflows/tpl-images.yml - secrets: inherit - with: - image-tag: ${{ github.sha }} - git-ref: ${{ github.ref }} - output: - name: Output Variables - needs: - - build + run-deployment: + name: Run Deployment runs-on: - metal steps: - - name: Show variables for the CI pipeline - run : | - echo '================================' - echo ' Use the following variables' - echo '' - echo "CI_PIPELINE_SOURCE: pipeline" - echo "DEV_IMAGE_TAG: ${{ github.sha }}" - echo "PROD_IMAGE_TAG: ${GIT_TAG##*/}" - shell: bash + - name: Sanitise variables + id: sanitise-vars + env: + IMAGE_TAG: "${{ github.sha }}" + GIT_REF: "${{ github.ref }}" + run: | + set -ex + + echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_OUTPUT + echo "GIT_REF=${GIT_REF##*/}" >> $GITHUB_OUTPUT + shell: bash + - name: Invoke octant-pipelines workflow + uses: benc-uk/workflow-dispatch@v1 + with: + workflow: deploy-prod.yml + repo: golemfoundation/octant-pipelines + inputs: '{"image_tag":"${{ steps.sanitise-vars.outputs.IMAGE_TAG }}","git_ref":"${{ steps.sanitise-vars.outputs.GIT_REF }}"}' + token: "${{ secrets.GH_BOT_TOKEN }}"