-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (71 loc) · 2.02 KB
/
deploy.yml
File metadata and controls
74 lines (71 loc) · 2.02 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
name: Deploy
run-name: Deploy ${{ inputs.git_tag || 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:
environment:
description: Deployment environment
required: true
type: choice
options:
- qa
- poc
- test
- preview
- training
- production
- copilotmigration
server_types:
description: Server types to deploy
required: true
type: choice
options:
- all
- web
- good-job
default: all
git_tag:
description: Git tag to deploy (optional). Will use workflow ref if not provided.
required: false
type: string
jobs:
determine-git-sha:
runs-on: ubuntu-latest
outputs:
git-sha: ${{ steps.get-git-sha.outputs.git-sha }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_tag || github.sha }}
- name: Get git sha
id: get-git-sha
run: echo "git-sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
build-and-push-image:
needs: determine-git-sha
uses: ./.github/workflows/build-and-push-image.yml
with:
git-sha: ${{ needs.determine-git-sha.outputs.git-sha }}
deploy-infrastructure:
needs: [build-and-push-image, determine-git-sha]
uses: ./.github/workflows/deploy-infrastructure.yml
with:
environment: ${{ inputs.environment }}
git-sha: ${{ needs.determine-git-sha.outputs.git-sha }}
deploy-application:
needs: [deploy-infrastructure, determine-git-sha]
uses: ./.github/workflows/deploy-application.yml
with:
environment: ${{ inputs.environment }}
image_tag: ${{ needs.determine-git-sha.outputs.git-sha }}
server_types: ${{ inputs.server_types }}