-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
84 lines (80 loc) · 2.68 KB
/
action.yaml
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
name: 'guardian/actions-static-site'
description: 'Deploy a Guardian static site.'
inputs:
app:
description: 'App name (pattern: [a-zA-Z-]+).'
required: true
domain:
description: A Guardian-owned domain. [name].gutools.co.uk is recommended.
required: true
artifact:
description: 'Name of artifact containing the static site. Should be uploaded in an earlier workflow step.'
required: false
default: 'artifact'
guActionsRiffRaffRoleArn:
description: "Role to use for writing to Riffraff's AWS bucket (typically org secret of same name)."
required: true
dryRun:
description: 'If set to true, will not upload Riffraff artifact.'
default: false
runs:
# Note composite steps do not have direct access to secrets, or inputs (via
# env) so need to be passed them explicitly :(. Sad times I know.
using: 'composite'
steps:
- name: CDK synth
shell: bash
run: |
cd ${{github.action_path}}
ls -hal
node index.js
env:
INPUT_APP: ${{ inputs.app }}
INPUT_DOMAIN: ${{ inputs.domain }}
INPUT_ARTIFACT: ${{ inputs.artifact }}
INPUT_DRYRUN: ${{ inputs.dryRun}}
INPUT_ACTIONS_RUNTIME_TOKEN: ${ github.token }
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact }}
path: site
- name: Display structure of downloaded files
shell: bash
run: ls -R
working-directory: site
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: eu-west-1
role-to-assume: ${{ inputs.guActionsRiffRaffRoleArn }}
- uses: guardian/actions-riff-raff@v2
with:
app: ${{ inputs.app }}
dryRun: ${{ inputs.dryRun }}
contentDirectories: |
cfn: [${{github.action_path}}/cfn.json]
static-site-assets: [site]
config: |
stacks:
- deploy
regions:
- eu-west-1
allowedStages:
- PROD
deployments:
cfn:
type: cloud-formation
app: ${{ inputs.app }}
parameters:
templatePath: cfn.json
static-site-assets:
type: aws-s3
app: ${{ inputs.domain }} # A hack to prefix uploads with the domain.
parameters:
cacheControl: private
publicReadAcl: false
bucket: deploy-infra-actions-static-site-i-staticd8c87b36-jyufgyb0llkj # TODO replace with SSM param once possible.
prefixApp: true # See comment on `app` above.
prefixStack: false
prefixStage: false
dependencies:
- cfn