-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (91 loc) · 3.49 KB
/
pr-open.yml
File metadata and controls
102 lines (91 loc) · 3.49 KB
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
name: Pull Request
on:
pull_request:
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
pr-greeting:
name: PR Greeting
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}-${{ github.event.number }}
runs-on: ubuntu-24.04
permissions:
pull-requests: write
steps:
- name: PR Greeting
uses: bcgov/action-pr-description-add@9bf88aec33edb7c00ed72f9305aa1721d0cdab9f # v2.0.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add_markdown: |
---
Thanks for the PR!
Any successful deployments (not always required) will be available below.
[API](https://${{ env.PREFIX }}-api.${{ env.DOMAIN }}/) available
[Frontend](https://${{ env.PREFIX }}.${{ env.DOMAIN }}/) available
Once merged, code will be promoted and handed off to following workflow run.
[Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml)
builds:
name: Builds
runs-on: ubuntu-24.04
permissions:
contents: read
attestations: write
id-token: write
packages: write
strategy:
matrix:
package: [api, database, frontend]
steps:
- uses: actions/checkout@v6
- uses: bcgov/action-builder-ghcr@2b24ac7f95e6a019064151498660437cca3202c5 # v4.2.1
with:
package: ${{ matrix.package }}
tags: ${{ github.event.number || github.sha }}
tag_fallback: latest
token: ${{ secrets.GITHUB_TOKEN }}
- uses: shrink/actions-docker-registry-tag@e6aaef25c595b6e0edd18bf4c7dbfea3abd43299 # v5
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ github.event.number || github.sha }}
tags: ${{ github.sha }}
deploys:
name: Deploys
needs: [builds]
permissions:
contents: read
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: false
tag: ${{ github.event.number }}
release_name: pubcode-${{ github.event.number }}
params: |
--set-string global.repository=${{ github.repository }} \
--set-string database.containers[0].tag="${{ github.sha }}" \
--set-string database.initContainers[0].tag="${{ github.sha }}" \
--set-string api.containers[0].tag="${{ github.sha }}" \
--set-string api.containers[0].resources.requests.cpu="30m" \
--set-string api.containers[0].resources.requests.memory="50Mi" \
--set-string frontend.containers[0].tag="${{ github.sha }}" \
--set-string frontend.containers[0].resources.requests.cpu="30m" \
--set-string frontend.containers[0].resources.requests.memory="50Mi" \
--set-string database.containers[0].resources.requests.cpu="30m" \
--set-string database.containers[0].resources.requests.memory="50Mi" \
--set-string database.initContainers[0].resources.requests.cpu="30m" \
--set-string database.initContainers[0].resources.requests.memory="50Mi" \
--set-string database.pvc.size="350Mi" \
--set-string global.env.VITE_SCHEMA_BRANCH=${{ github.event.pull_request.head.ref }} \
tests:
name: Tests
needs: [deploys]
permissions:
contents: read
uses: ./.github/workflows/.tests.yml
with:
target: ${{ github.event.number }}