-
Notifications
You must be signed in to change notification settings - Fork 39
63 lines (56 loc) · 1.97 KB
/
core-web.deploy.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CORE WEB - Promote TEST
on:
workflow_dispatch:
env:
ORIG_TAG: dev
PROMOTE_TAG: test
jobs:
promote-image-to-test:
name: promote-core-web-to-test
runs-on: ubuntu-20.04
steps:
- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.7"
- name: oc login
run: |
oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }}
- name: Promote core-web from dev to test
run: |
oc -n ${{secrets.NS_TOOLS}} tag \
${{ secrets.NS_TOOLS }}/frontend:${{ env.ORIG_TAG }} \
${{ secrets.NS_TOOLS }}/frontend:${{ env.PROMOTE_TAG }}
trigger-gitops:
runs-on: ubuntu-20.04
timeout-minutes: 15
needs: promote-image-to-test
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Git Ops Push
run: ./gitops/commit.sh core-web dev test ${{ github.actor }} ${{ secrets.GH_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Install oc
if: ${{ env.NEEDS_ROLLOUT=='true' }}
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.7"
- name: Setup ArgoCD CLI
uses: imajeetyadav/argocd-cli@v1
with:
version: v2.7.9 # optional
- name: oc login
if: ${{ env.NEEDS_ROLLOUT=='true' }}
run: oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }}
- name: Notification
if: ${{ env.NEEDS_ROLLOUT=='true' }}
run: ./gitops/watch-deployment.sh core-web test ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} ${{ secrets.ARGOCD_SERVER }} ${{ secrets.ARGO_CD_CLI_JWT }}
run-if-failed:
runs-on: ubuntu-20.04
needs: [trigger-gitops]
if: always() && (needs.trigger-gitops.result == 'failure')
steps:
- name: Notification
run: ./gitops/watch-deployment.sh core-web test ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} 1