-
Notifications
You must be signed in to change notification settings - Fork 36
80 lines (68 loc) · 1.83 KB
/
main.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
name: Main
permissions: write-all
on:
push:
branches:
- main
jobs:
check:
name: Check
uses: ./.github/workflows/_check.yaml
release:
uses: ./.github/workflows/_release.yaml
needs:
- check
create-deploy-env:
runs-on: ubuntu-latest
needs:
- release
outputs:
deploy-env: ${{ steps.output-deploy-env.outputs.deploy-env }}
steps:
- uses: actions/checkout@v3
- name: Set env to staging
id: set-env-staging
if: endsWith(github.ref, 'heads/main')
run: |
echo "DEPLOY_ENV=staging" >> $GITHUB_ENV
- name: Set env to production
id: set-env-production
if: ${{ needs.release.outputs.created }}
run: |
echo "DEPLOY_ENV=prd-v0274" >> $GITHUB_ENV
- name: Output App Env
id: output-deploy-env
run: |
echo "deploy-env=${DEPLOY_ENV}" >> $GITHUB_OUTPUT
build:
needs:
- release
- create-deploy-env
uses: ./.github/workflows/_build.yaml
with:
image-tags: ${{ needs.release.outputs.tag_name }}
deploy-env: ${{ needs.create-deploy-env.outputs.deploy-env }}
secrets:
aws-ecr-repo-name: ${{ secrets.AWS_ECR_REPO_NAME }}
stg:
if: ${{ !needs.release.outputs.created }}
needs:
- create-deploy-env
- release
- build
uses: ./.github/workflows/_deploy.yaml
with:
image-tag: ${{ needs.release.outputs.tag_name }}
deploy-env: ${{ needs.create-deploy-env.outputs.deploy-env }}
secrets: inherit
prod:
if: ${{ needs.release.outputs.created }}
needs:
- create-deploy-env
- build
- release
uses: ./.github/workflows/_deploy.yaml
with:
image-tag: ${{ needs.release.outputs.tag_name }}
deploy-env: ${{ needs.create-deploy-env.outputs.deploy-env }}
secrets: inherit