Skip to content

Deploy to Test

Deploy to Test #234

Workflow file for this run

name: Deploy to Test
on:
workflow_dispatch:
inputs:
releaseTag:
description: "Tag of version to be promoted to TEST"
required: true
env:
TOOLS_NAMESPACE: ${{ secrets.OPENSHIFT_GOLD_LICENSE_PLATE }}-tools
ENVIRONMENT: test
NAMESPACE: ${{ secrets.OPENSHIFT_GOLD_LICENSE_PLATE }}-test
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Attempt to checkout tag
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.releaseTag }}
- name: Tag not found
if: ${{ failure() }}
run: |
echo "::error::Git Tag not found, please double check input"
exit 1
- name: Login OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_GOLD_SERVER_URL }}
openshift_token: ${{ secrets.OPENSHIFT_GOLD_SERVICE_TOKEN }}
- name: Tag Test images
run: |
oc -n ${{ env.TOOLS_NAMESPACE }} tag admin-main:${{ github.event.inputs.releaseTag }} admin-main:${{ env.ENVIRONMENT }}
oc -n ${{ env.TOOLS_NAMESPACE }} tag public-builder-main:${{ github.event.inputs.releaseTag }} public-builder-main:${{ env.ENVIRONMENT }}
oc -n ${{ env.TOOLS_NAMESPACE }} tag strapi-main:${{ github.event.inputs.releaseTag }} strapi-main:${{ env.ENVIRONMENT }}
oc -n ${{ env.TOOLS_NAMESPACE }} tag maintenance-main:${{ github.event.inputs.releaseTag }} maintenance-main:${{ env.ENVIRONMENT }}
oc -n ${{ env.TOOLS_NAMESPACE }} tag etl-main:${{ github.event.inputs.releaseTag }} etl-main:${{ env.ENVIRONMENT }}
oc -n ${{ env.TOOLS_NAMESPACE }} tag scheduler-main:${{ github.event.inputs.releaseTag }} scheduler-main:${{ env.ENVIRONMENT }}
- name: Trigger Gatsby static build workflow
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: publish-gatsby
client-payload: '{"env": "${{ env.ENVIRONMENT }}", "branch": "main"}'
- name: Trigger new rollout
run: |
oc -n ${{ env.NAMESPACE }} rollout restart deployment main-admin
oc -n ${{ env.NAMESPACE }} rollout restart deployment main-cms
oc -n ${{ env.NAMESPACE }} rollout restart deployment main-maintenance
oc -n ${{ env.NAMESPACE }} rollout restart deployment main-scheduler