generated from bcgov/bcrs-template-ui
-
Notifications
You must be signed in to change notification settings - Fork 14
60 lines (50 loc) · 2.17 KB
/
restart-services-hourly.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
name: Restart Services hourly
on:
schedule:
# At every hour
- cron: "0 * * * *"
workflow_dispatch:
inputs:
environement:
description: "Environment (dev/test/prod)"
required: true
default: "prod"
jobs:
restart-services:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set env by input
run: |
echo "TAG_NAME=${{ github.event.inputs.environement }}" >> $GITHUB_ENV
- name: Set env
if: env.TAG_NAME == ''
run: |
echo "TAG_NAME=prod" >> $GITHUB_ENV
- name: Login Openshift
run: |
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}}
#- name: Restart namex-pay
# run: |
# oc scale --replicas=0 dc/namex-pay-${{ env.TAG_NAME }} -n f2b77c-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/namex-pay-${{ env.TAG_NAME }} -n f2b77c-${{ env.TAG_NAME }}
#- name: Restart entity-pay
# run: |
# oc scale --replicas=0 dc/entity-pay-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/entity-pay-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
- name: Restart entity-filer
run: |
oc scale --replicas=0 dc/entity-filer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/entity-filer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
- name: Restart entity-emailer
run: |
oc scale --replicas=0 dc/entity-emailer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/entity-emailer-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
- name: Restart entity-bn
run: |
oc scale --replicas=0 dc/entity-bn-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
oc scale --replicas=1 dc/entity-bn-${{ env.TAG_NAME }} -n cc892f-${{ env.TAG_NAME }}
#- name: Restart account-mailer
# run: |
# oc scale --replicas=0 dc/account-mailer-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}
# oc scale --replicas=1 dc/account-mailer-${{ env.TAG_NAME }} -n 6e0e49-${{ env.TAG_NAME }}