-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (67 loc) · 2.17 KB
/
cd.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
name: Continuous Delivery
on:
push:
jobs:
infra:
runs-on: ubuntu-latest
name: deploy infrastructure
permissions:
contents: read
id-token: write
outputs:
StaticSiteBucketName: ${{ steps.deploy.outputs.StaticSiteBucketName }}
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::865116139480:role/github-actions-limulus-dot-net-cf
aws-region: us-west-2
- uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: limulus-dot-net-${{ github.ref_name }}
template: infra.yaml
no-fail-on-empty-changeset: '1'
capabilities: 'CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND'
parameter-overrides: >-
BranchName=${{ github.ref_name }},
LimulusDotNetZoneId=${{ secrets.LIMULUS_DOT_NET_ZONE_ID }},
LimulusDotNetCertificateArn=${{ secrets.LIMULUS_DOT_NET_CERTIFICATE_ARN }}
build:
runs-on: ubuntu-latest
name: build website
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: dist-www
path: dist/www
retention-days: 15
deploy:
needs:
- infra
- build
name: deploy website
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- run: echo "StaticSiteBucketName ${{ needs.infra.outputs.StaticSiteBucketName }}"
# - uses: actions/download-artifact@v4
# with:
# name: dist-www
# path: www
# - uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::865116139480:role/github-actions-limulus-penumbra
# aws-region: us-west-2
# - run: aws s3 sync www s3://${{ needs.infra.outputs.StaticSiteBucketName }} --delete --cache-control max-age=60,public