forked from cds-snc/notification-api
-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (61 loc) · 1.86 KB
/
dev_deploy.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
name: Deploy to Env - API
on:
workflow_dispatch:
inputs:
environment:
description: "Deployment environment (dev|perf|staging|prod)"
default: dev
required: true
ref:
description: "Branch or Commit"
default: master
required: true
lambdaDeploy:
description: "Include Lambda in deployment?"
default: false
required: false
type: boolean
jobs:
setup-environment:
name: "setup-env-${{ inputs.environment }}"
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
outputs:
git-hash: ${{ steps.set-hash.outputs.commit-hash }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Set Hash
id: set-hash
run: |
echo "commit-hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Env Values
run: |
echo "The environment is ${{ inputs.environment }}"
echo "The branch/tag is ${{ inputs.ref }}"
echo "The commit hash is ${{ steps.set-hash.outputs.commit-hash }}"
run-build:
needs: [setup-environment]
uses: ./.github/workflows/build.yml
with:
environment: "${{ inputs.environment }}"
ref: "${{ needs.setup-environment.outputs.git-hash }}"
secrets: inherit
run-lambda-deploy:
if: ${{ inputs.lambdaDeploy }}
needs: [setup-environment]
uses: ./.github/workflows/lambda-functions.yml
with:
environment: "${{ inputs.environment }}"
ref: "${{ needs.setup-environment.outputs.git-hash }}"
lambdaName: "All"
secrets: inherit
run-deployment:
needs: [setup-environment, run-build]
uses: ./.github/workflows/deployment.yml
with:
environment: "${{ inputs.environment }}"
ref: "${{ needs.setup-environment.outputs.git-hash }}"
secrets: inherit