Deploy Alpha to Alpha-Test #374
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Alpha to Alpha-Test | |
on: | |
workflow_dispatch | |
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: Install OpenShift CLI tools | |
uses: redhat-actions/openshift-tools-installer@v1 | |
with: | |
oc: "4.14" | |
- 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-alpha:latest admin-alpha:${{ env.ENVIRONMENT }} | |
oc -n ${{ env.TOOLS_NAMESPACE }} tag public-builder-alpha:latest public-builder-alpha:${{ env.ENVIRONMENT }} | |
oc -n ${{ env.TOOLS_NAMESPACE }} tag strapi-alpha:latest strapi-alpha:${{ env.ENVIRONMENT }} | |
oc -n ${{ env.TOOLS_NAMESPACE }} tag maintenance-alpha:latest maintenance-alpha:${{ env.ENVIRONMENT }} | |
oc -n ${{ env.TOOLS_NAMESPACE }} tag etl-alpha:latest etl-alpha:${{ env.ENVIRONMENT }} | |
oc -n ${{ env.TOOLS_NAMESPACE }} tag scheduler-alpha:latest scheduler-alpha:${{ 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": "alpha"}' | |
- name: Trigger new rollout | |
run: | | |
oc -n ${{ env.NAMESPACE }} rollout restart deployment alpha-admin | |
oc -n ${{ env.NAMESPACE }} rollout restart deployment alpha-cms | |
oc -n ${{ env.NAMESPACE }} rollout restart deployment alpha-maintenance | |
oc -n ${{ env.NAMESPACE }} rollout restart deployment alpha-scheduler |