-
Notifications
You must be signed in to change notification settings - Fork 18
47 lines (40 loc) · 1.92 KB
/
deploy-alpha-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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