-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.77 KB
/
deploy.yml
File metadata and controls
63 lines (54 loc) · 1.77 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
name: Deploy Site
on:
push:
branches:
- master
paths-ignore:
- 'infra/**'
- '*.md'
- 'LICENSE.txt'
- '.gitignore'
permissions:
id-token: write
contents: read
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Sync all files to S3
run: |
aws s3 sync . s3://${{ secrets.S3_BUCKET_NAME }} \
--delete \
--exclude ".git/*" \
--exclude ".github/*" \
--exclude ".claude/*" \
--exclude "README.*" \
--exclude "LICENSE.txt" \
--exclude "infra/*" \
--exclude "*.md" \
--exclude ".gitignore" \
--cache-control "public, max-age=1800"
- name: Set short cache on HTML files
run: |
aws s3 cp s3://${{ secrets.S3_BUCKET_NAME }}/ s3://${{ secrets.S3_BUCKET_NAME }}/ \
--recursive \
--exclude "*" \
--include "*.html" \
--metadata-directive REPLACE \
--cache-control "public, max-age=120" \
--content-type "text/html; charset=utf-8"
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} \
--paths "/*"