-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (56 loc) · 2.12 KB
/
cd-domain-name.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
name: CD domain name
on:
workflow_dispatch:
inputs:
DomainName:
type: string
required: true
description: The custom domain name to create
CertificateArn:
type: string
required: true
description: Arn of the domain name's certificate
ApiTargetId:
type: string
required: true
description: Id of the targeted API
ApiStage:
type: string
required: true
description: The desired stage of the API
default: Prod
jobs:
cd-custom-domain:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
AWS_REGION: eu-west-3
steps:
- uses: actions/checkout@v4.1.1
- name: Configure preprod AWS credentials
if: ${{ github.ref_name == 'preprod' }}
uses: aws-actions/configure-aws-credentials@v4.0.1
with:
aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Configure prod AWS credentials
if: ${{ github.ref_name == 'prod' }}
uses: aws-actions/configure-aws-credentials@v4.0.1
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Deploy custom domain stack
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: ${{ github.ref_name }}-custom-domain-bpartners-annotator
template: cf-stacks/domain-name-stack.yml
tags: "[ { \"Key\": \"app\", \"Value\": \"bpartners-annotator\" }, { \"Key\": \"env\", \"Value\": \"${{ github.ref_name }}\" } ]"
capabilities: CAPABILITY_NAMED_IAM
no-fail-on-empty-changeset: "1"
parameter-overrides:
"DomainName=${{ github.event.inputs.DomainName }},
CertificateArn=${{ github.event.inputs.CertificateArn }},
ApiTargetId=${{ github.event.inputs.ApiTargetId }},
ApiStage=${{ github.event.inputs.ApiStage }}"