Skip to content

Commit

Permalink
Add production deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-code committed Apr 4, 2024
1 parent 016c63c commit 041b149
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

0 comments on commit 041b149

Please sign in to comment.