This repository has been archived by the owner on Jul 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (52 loc) · 1.78 KB
/
deploy_prod.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
# This action should:
# - trigger on merge of pr
# - tag the master with the image tag
# - deploy to prod
#
# https://gitpro.ttaallkk.topmunity/t/run-action-only-when-a-pr-is-merged/18268
name: deploy prod
on:
pull_request:
branches: ['master', 'main']
types:
- closed
# debugging
# -------------
# on:
# push:
# branches: ['dev', 'smk-cdci']
jobs:
deployprod:
# Commented out for testing
if: github.event.pull_request.merged == true
defaults:
run:
shell: bash
runs-on: ubuntu-20.04
env:
OPENSHIFT_SERVER_URL: ${{secrets.OPENSHIFT_SERVER_URL}}
OPENSHIFT_TOKEN_DEV: ${{secrets.OPENSHIFT_TOKEN_DEV}}
OPENSHIFT_TOKEN_PROD: ${{secrets.OPENSHIFT_TOKEN_PROD}}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
steps:
# CHECKOUT THE CODE
- uses: actions/checkout@v2
id: checkout
if: env.OPENSHIFT_SERVER_URL != '' && env.OPENSHIFT_TOKEN_DEV != '' && env.GHCR_USER != '' && env.GHCR_TOKEN != ''
with:
fetch-depth: 0
- name: deploying prod
#uses: ./comp-actions/smk-deploy
uses: bcgov/smk-actions/smk-deploy@main
id: deploySMKContainer
if: env.OPENSHIFT_SERVER_URL != '' && env.OPENSHIFT_TOKEN_DEV != '' && env.GHCR_USER != '' && env.GHCR_TOKEN != ''
with:
OPENSHIFT_SERVER_URL: ${{ secrets.OPENSHIFT_SERVER_URL }}
OPENSHIFT_TOKEN_DEV: ${{ secrets.OPENSHIFT_TOKEN_DEV }}
OPENSHIFT_TOKEN_PROD: ${{ secrets.OPENSHIFT_TOKEN_PROD }}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
DOCKER_REGISTRY: 'docker.pkg.github.com'
PR_REVIEWERS: '["GuyTheFlower", "NicoledeGreef"]'
PR_MENTIONS: '["GuyTheFlower", "NicoledeGreef", "franTarkenton"]'