generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (88 loc) · 3.42 KB
/
merge.yml
File metadata and controls
94 lines (88 loc) · 3.42 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
name: Merge to Main
on:
workflow_run:
workflows: [Pull Request Closed]
types: [completed]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
semantic-version:
outputs:
semanticVersion: ${{ steps.changelog.outputs.version }} # this is without v 1.0.0
tag: ${{ steps.changelog.outputs.tag }} # this is with v, v1.0.0
clean_changelog: ${{ steps.changelog.outputs.clean_changelog }}
runs-on: ubuntu-24.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v6
- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@84dadaf2c367cb52af02737cd9c7e888807219e7 # v6.2.0
id: changelog
with:
github-token: ${{ github.token }}
output-file: "CHANGELOG.md"
skip-version-file: "true"
skip-commit: "true"
skip-on-empty: "false"
git-push: "true"
retag-images:
needs: [semantic-version]
runs-on: ubuntu-24.04
strategy:
matrix:
package: [api, database, frontend]
steps:
- name: Tag Docker Images
uses: shrink/actions-docker-registry-tag@f04afd0559f66b288586792eb150f45136a927fa # v4
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: latest
tags: |
${{ needs.semantic-version.outputs.semanticVersion }}
${{ needs.semantic-version.outputs.tag }}
deploys:
name: TEST Deployments
needs: [retag-images, semantic-version]
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: true
environment: test
tag: ${{ needs.semantic-version.outputs.semanticVersion }} # this is without v
release_name: pubcode-test
params: --set-string database.containers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string database.initContainers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.tag }}"
tests:
name: Tests
needs: [deploys]
uses: ./.github/workflows/.tests.yml
with:
target: test
deploys-prod:
name: PROD Deployments
needs: [semantic-version, tests]
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
autoscaling: true
environment: prod
tag: ${{ needs.semantic-version.outputs.semanticVersion }}
release_name: pubcode
params: --set-string database.containers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string database.initContainers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string api.containers[0].tag="${{ needs.semantic-version.outputs.tag }}" --set-string frontend.containers[0].tag="${{ needs.semantic-version.outputs.tag }}"
github_release:
name: Create Release
needs: [semantic-version, deploys-prod]
runs-on: ubuntu-24.04
steps:
- name: Create Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
with:
token: ${{ github.token }}
tag_name: ${{ needs.semantic-version.outputs.tag }}
name: ${{ needs.semantic-version.outputs.tag }}
body: ${{ needs.semantic-version.outputs.clean_changelog }}