-
Notifications
You must be signed in to change notification settings - Fork 5
85 lines (74 loc) · 2.76 KB
/
Copy pathdeploy.yml
File metadata and controls
85 lines (74 loc) · 2.76 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
84
85
name: deploy
on:
workflow_dispatch:
inputs:
environment:
description: Environment
required: true
default: int
type: choice
options:
- int
trigger:
description: What triggered the workflow
default: deploy.yml - github
required: false
workflow_call:
inputs:
environment:
description: Environment
required: true
type: string
trigger:
description: What triggered the workflow
required: true
type: string
env:
FORCE_COLOR: '1'
concurrency:
group: deploy-${{ inputs.environment || 'int' }}
cancel-in-progress: false
run-name: Deploy to ${{ inputs.environment || 'int' }}
permissions:
contents: read
id-token: write
jobs:
build:
uses: ./.github/workflows/build.yml
secrets: inherit
with:
deploy-env: ${{ inputs.environment || 'int' }}
environment: ${{ inputs.environment || 'int' }}
# we use github.sha here to ensure that the cache is invalidated on every new commit
cache-key: ${{ inputs.environment || 'int' }}-${{ github.sha }}
is-deployment: true
deploy:
environment: ${{ inputs.environment || 'int' }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Restore build 🗃️
uses: actions/cache/restore@v4
with:
path: |
./
key: |
${{ github.head_ref || github.ref_name }}-${{ github.sha }}-${{ inputs.environment || 'int' }}
- name: Log into aws dev 🔑
uses: ./.github/actions/login-dev-deploy
- name: Deploying ${{ inputs.environment || 'int' }} 📍
uses: ./.github/actions/deploy
with:
DEPLOY_ENV: ${{ inputs.environment || 'int' }}
- name: Get site hostname 🌎
id: hostname
shell: bash
run: |
HOSTNAME=$(cat es-ds-docs/aws/cdk-outputs.json | jq -r 'map(.Route53HostName)[0]' )
echo "hostname=$HOSTNAME" >> $GITHUB_OUTPUT
- name: Post slack notification 💬
uses: ./.github/actions/slack
with:
slack-token: ${{ secrets.SLACK_TOKEN }}
slack-channel: ${{ vars.SLACK_CHANNEL }}
slack-message: "🚀New ESDS Deployment🚀\nURL: ${{ steps.hostname.outputs.hostname }}\nRequested By: ${{ github.actor }}\nTrigger: ${{ inputs.trigger || 'deploy.yml - push to main' }}"