-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 2.21 KB
/
main.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
name: Main - reports to https://app.kosli.com
on:
push:
branches:
- main
jobs:
variables:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.vars.outputs.image_tag }}
steps:
- name: Prepare
id: vars
run: echo "image_tag=$(echo $GITHUB_SHA | head -c7)" >> ${GITHUB_OUTPUT}
create-kosli-flow:
uses: ./.github/workflows/sub_create_kosli_flow.yml
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
build-image:
needs: [variables, create-kosli-flow]
uses: ./.github/workflows/sub_build_image.yml
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
test:
needs: [variables, build-image]
uses: ./.github/workflows/sub_test.yml
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
sdlc-gate:
needs: [variables, test]
uses: ./.github/workflows/sub_sdlc_gate.yml
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
approve-deployment-to-beta:
needs: [variables, sdlc-gate]
uses: ./.github/workflows/sub_approve_deployment.yml
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-beta
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
deploy-to-beta:
needs: [variables, approve-deployment-to-beta]
uses: ./.github/workflows/sub_deploy_to_beta.yml
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
approve-deployment-to-prod:
needs: [variables, deploy-to-beta]
uses: ./.github/workflows/sub_approve_deployment.yml
secrets:
KOSLI_API_TOKEN: ${{ secrets.KOSLI_API_TOKEN }}
with:
KOSLI_ENVIRONMENT: aws-prod
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}
deploy-to-prod:
needs: [variables, approve-deployment-to-prod]
uses: ./.github/workflows/sub_deploy_to_prod.yml
with:
IMAGE_TAG: ${{ needs.variables.outputs.image_tag }}