-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (78 loc) · 2.62 KB
/
legacy-pr.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Pull Request Legacy
on:
pull_request:
workflow_dispatch:
concurrency:
# PR open and close use the same group, allowing only one at a time
group: ${{ github.event.number }}
cancel-in-progress: true
jobs:
vars:
name: Variables
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.semver.outputs.tag }}
url: ${{ steps.calculate.outputs.url }}
steps:
# steps.semver.outputs.tag => needs.vars.outputs.semver
- uses: actions/checkout@v4
with:
ref: refs/heads/${{ github.event.repository.default_branch }}
- name: Conventional Changelog Update
uses: TriPSs/[email protected]
id: semver
with:
git-branch: refs/heads/${{ github.head_ref }}
git-push: 'false'
skip-commit: 'true'
skip-on-empty: 'false'
skip-version-file: 'true'
# steps.calculate.outputs.url => needs.vars.outputs.url
- name: Calculate the deployment number
id: calculate
run: |
echo "url=${{ github.event.repository.name }}-$((${{ github.event.number }} % 50))-frontend.apps.silver.devops.gov.bc.ca" >> $GITHUB_OUTPUT
- run: |
echo "semver=${{ steps.semver.outputs.tag }}"
echo "url=${{ steps.calculate.outputs.url }}"
builds:
name: Builds
runs-on: ubuntu-22.04
needs: [vars]
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: bcgov-nr/[email protected]
name: Build (Legacy db)
with:
package: legacydb
build_file: ./database/Dockerfile.legacy
tag: latest
tag_fallback: test
triggers: ('database/')
build_args: |
APP_VERSION=${{ needs.vars.outputs.semver }}-${{ github.event.number }}
deploy:
name: Deploy Application
needs: [builds, vars]
environment: tools
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ needs.vars.outputs.url }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Initializing Deployment
uses: bcgov-nr/[email protected]
with:
file: database/openshift.legacy.yml
oc_namespace: ${{ secrets.OC_NAMESPACE }}
oc_server: ${{ secrets.OC_SERVER }}
oc_token: ${{ secrets.OC_TOKEN }}
overwrite: false
parameters:
-p ZONE=tools
-p ORACLEDB_USER_W=${{ secrets.ORACLEDB_USERNAME_W }}
-p ORACLEDB_PASSWORD_W=${{ secrets.ORACLEDB_PASSWORD_W }}
-p PROMOTE=${{ github.repository }}/legacydb:latest