generated from mats16/codespaces-cdk-template
-
Notifications
You must be signed in to change notification settings - Fork 57
54 lines (46 loc) · 1.41 KB
/
waf-cfn-publish.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
name: waf-cfn-publish
on:
push:
branches:
- main
workflow_dispatch: {}
env:
BSS_FILE_ASSET_BUCKET_NAME: 'supabase-on-aws-${AWS::Region}'
BSS_FILE_ASSET_REGION_SET: us-east-1
BSS_FILE_ASSET_PREFIX: latest/
jobs:
latest:
name: Latest Cfn templates
runs-on: ubuntu-latest
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
src/supabase-waf-stack.ts
.projenrc.js
.github/workflows/waf-cfn-publish.yml
- name: node.js setup
if: env.GIT_DIFF
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
if: env.GIT_DIFF
run: yarn install --check-files
- name: Configure AWS credentials
if: env.GIT_DIFF
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CDK_PUBLISHING_ROLE }}
aws-region: us-west-2
- name: cdk synth
if: env.GIT_DIFF
run: npx projen synth --name SupabaseWaf --no-version-reporting
- name: Publish assets
if: env.GIT_DIFF
run: aws s3 cp cdk.out/SupabaseWaf.template.json s3://supabase-on-aws-us-east-1/latest/SupabaseWaf.template.json