-
Notifications
You must be signed in to change notification settings - Fork 16
83 lines (80 loc) · 2.34 KB
/
deploy.yml
File metadata and controls
83 lines (80 loc) · 2.34 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
name: Deploy
run-name: Deploy ${{ inputs.git_ref_to_deploy || github.ref_name }} to ${{ inputs.environment }}
concurrency:
group: deploy-${{ inputs.environment }}
on:
workflow_call:
inputs:
environment:
required: true
type: string
server_types:
required: true
type: string
workflow_dispatch:
inputs:
git_ref_to_deploy:
description:
| # Use blank unicode character (U+2800) to force line-break
Use code from: ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
(Git ref to deploy, for example, a tag, branch name or commit SHA. Will use workflow ref if not provided.)
type: string
environment:
description: Deployment environment
required: true
type: choice
options:
- qa
- test
- preview
- training
- production
- sandbox-alpha
- sandbox-beta
server_types:
description: Server types to deploy
required: true
type: choice
options:
- all
- web
- good-job
default: all
jobs:
determine-git-sha:
runs-on: ubuntu-latest
permissions: {}
outputs:
git-sha: ${{ steps.get-git-sha.outputs.git-sha }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref_to_deploy || github.sha }}
- name: Get git sha
id: get-git-sha
run: echo "git-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
build-and-push-image:
permissions:
id-token: write
needs: determine-git-sha
uses: ./.github/workflows/build-and-push-image.yml
with:
git-sha: ${{ needs.determine-git-sha.outputs.git-sha }}
deploy-infrastructure:
permissions:
id-token: write
needs: [build-and-push-image, determine-git-sha]
uses: ./.github/workflows/deploy-infrastructure.yml
with:
environment: ${{ inputs.environment }}
image_tag: ${{ needs.determine-git-sha.outputs.git-sha }}
deploy-application:
permissions:
id-token: write
needs: deploy-infrastructure
uses: ./.github/workflows/deploy-application.yml
with:
environment: ${{ inputs.environment }}
server_types: ${{ inputs.server_types }}
git_sha_to_deploy: ${{ needs.determine-git-sha.outputs.git-sha }}