forked from bcgov/traction
-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (104 loc) · 4.75 KB
/
on_push_services.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Push Instance to Develop
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- 'plugins/**'
- 'services/tenant-ui/**'
- 'charts/traction/**'
- 'charts/tenant-ui/**'
jobs:
build_ui:
name: 'Build Tenant UI'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v3
- name: Build service
uses: ./.github/actions/build_ui
id: builder
with:
context: './services/tenant-ui'
image_name: ${{ github.repository_owner}}/traction-tenant-ui
registry: ghcr.io
registry_username: ${{ github.repository_owner}}
registry_password: ${{ secrets.GITHUB_TOKEN }}
outputs:
image_tag: ${{ steps.builder.outputs.image_tag }}
image_version: ${{ steps.builder.outputs.image_version }}
buildtime: ${{ steps.builder.outputs.buildtime }}
build_acapy:
name: 'Build Traction Aca-Py'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v3
- name: Build Aca-Py Image
uses: ./.github/actions/build_acapy
id: builder
with:
context: './plugins'
dockerfile: './plugins/docker/Dockerfile'
image_name: ${{ github.repository_owner}}/traction-plugins-acapy
registry: ghcr.io
registry_username: ${{ github.repository_owner}}
registry_password: ${{ secrets.GITHUB_TOKEN }}
outputs:
image_tag: ${{ steps.builder.outputs.image_tag }}
image_version: ${{ steps.builder.outputs.image_version }}
buildtime: ${{ steps.builder.outputs.buildtime }}
build_proxy:
name: 'Build Traction Tenant Proxy'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v3
- name: Build Aca-Py Image
uses: ./.github/actions/build_acapy
id: builder
with:
context: './plugins'
dockerfile: './plugins/docker/Dockerfile.tenant-proxy'
image_name: ${{ github.repository_owner}}/traction-tenant-proxy
registry: ghcr.io
registry_username: ${{ github.repository_owner}}
registry_password: ${{ secrets.GITHUB_TOKEN }}
outputs:
image_tag: ${{ steps.builder.outputs.image_tag }}
image_version: ${{ steps.builder.outputs.image_version }}
buildtime: ${{ steps.builder.outputs.buildtime }}
deploy:
name: Deploy Dev
environment: development
runs-on: ubuntu-latest
needs:
- build_ui
- build_acapy
- build_proxy
if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }}
steps:
- uses: actions/checkout@v3
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
certificate_authority_data: ${{ secrets.OPENSHIFT_CA_CRT }}
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }}
- name: Traction Dev Helm
run: |
yq eval '.acapy.image.tag = "${{ needs.build_acapy.outputs.image_tag }}"' -i ./charts/traction/values-development.yaml
yq eval '.acapy.image.version = "${{ needs.build_acapy.outputs.image_version }}"' -i ./charts/traction/values-development.yaml
yq eval '.acapy.image.buildtime = "${{ needs.build_acapy.outputs.buildtime }}"' -i ./charts/traction/values-development.yaml
yq eval '.tenant_proxy.image.tag = "${{ needs.build_proxy.outputs.image_tag }}"' -i ./charts/traction/values-development.yaml
yq eval '.tenant_proxy.image.version = "${{ needs.build_proxy.outputs.image_version }}"' -i ./charts/traction/values-development.yaml
yq eval '.tenant_proxy.image.buildtime = "${{ needs.build_proxy.outputs.buildtime }}"' -i ./charts/traction/values-development.yaml
helm upgrade -f ./charts/traction/values.yaml -f ./charts/traction/values-development.yaml traction ./charts/traction --install --wait
- name: Tenant UI Dev Helm
run: |
yq eval '.tenant_ui.image.tag = "${{ needs.build_ui.outputs.image_tag }}"' -i ./charts/tenant-ui/values-development.yaml
yq eval '.tenant_ui.image.version = "${{ needs.build_ui.outputs.image_version }}"' -i ./charts/tenant-ui/values-development.yaml
yq eval '.tenant_ui.image.buildtime = "${{ needs.build_ui.outputs.buildtime }}"' -i ./charts/tenant-ui/values-development.yaml
helm upgrade -f ./charts/tenant-ui/values.yaml -f ./charts/tenant-ui/values-development.yaml tenant-ui ./charts/tenant-ui --install --wait