-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (65 loc) · 1.54 KB
/
ci-cd.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
name: CI/CD
on:
push:
branches: [ main ]
paths-ignore:
- "Test/**" # ignore changes to tests
jobs:
test:
name: QA
uses: ./.github/workflows/test-application.yml
deploy-test:
name: Internal test
uses: ./.github/workflows/deploy-to-environment.yml
if: always() && !failure() && !cancelled()
permissions:
id-token: write
contents: read
packages: write
secrets: inherit
with:
environment: test
deploy-staging:
name: Internal staging
uses: ./.github/workflows/deploy-to-environment.yml
if: always() && !failure() && !cancelled()
needs: [
deploy-test
]
permissions:
id-token: write
contents: read
packages: write
secrets: inherit
with:
environment: staging
deploy-production:
name: Production
needs: [
deploy-staging,
]
uses: ./.github/workflows/deploy-to-environment.yml
if: (!failure() && !cancelled())
permissions:
id-token: write
contents: read
packages: write
secrets: inherit
with:
environment: production
release-to-git:
name: Release to git
runs-on: ubuntu-latest
needs: [deploy-production]
if: ${{ !failure() && !cancelled()}}
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: release
if: (!failure() && !cancelled())
uses: ./.github/actions/release-to-git
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}