-
Notifications
You must be signed in to change notification settings - Fork 4
102 lines (94 loc) · 2.51 KB
/
merge.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Merge
on:
push:
branches: [main]
paths-ignore:
- '*.md'
- '.graphics/**'
- '.github/**'
- '!.github/workflows/merge.yml'
jobs:
semver:
name: Semantic Version and Tag
outputs:
tag: ${{ steps.changelog.outputs.tag }}
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
# Outputs semver as steps.id.outputs.tag
- name: Conventional Changelog Update
uses: TriPSs/conventional-changelog-action@v4
id: changelog
with:
git-branch: refs/heads/${{ github.event.repository.default_branch }}
git-push: "false"
github-token: ${{ github.token }}
skip-commit: "true"
skip-on-empty: "false"
skip-version-file: "true"
# Create tag and output semver
- name: Create Tags
run: |
echo git tag ${{ steps.changelog.outputs.tag }}
echo git push origin --tag
# Add tag number and latest tags to PR image
retags:
name: Retag Images
needs: [semver]
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [migrations, backend, frontend]
timeout-minutes: 1
steps:
- uses: shrink/actions-docker-registry-tag@v3
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ github.event.number }}
tags: |
latest
${{ needs.semver.outputs.tag }}
deploy-test:
name: Deploy (test)
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
environment: test
tag: ${{ github.event.number }}
release: test
integration-e2e:
name: Integration and E2E Tests
needs: [deploy-test]
uses: ./.github/workflows/.tests.yml
with:
target: test
deploy-prod:
name: Deploy (prod)
needs: [integration-e2e]
uses: ./.github/workflows/.deploy.yml
secrets: inherit
with:
environment: prod
tag: ${{ github.event.number }}
release: prod
promote:
name: Promote Images
needs: [deploy-prod]
runs-on: ubuntu-22.04
permissions:
packages: write
strategy:
matrix:
package: [migrations, backend, frontend]
timeout-minutes: 1
steps:
- uses: shrink/actions-docker-registry-tag@v3
with:
registry: ghcr.io
repository: ${{ github.repository }}/${{ matrix.package }}
target: ${{ github.event.number }}
tags: prod