-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1004 Bytes
/
deploy.yml
File metadata and controls
33 lines (31 loc) · 1004 Bytes
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
name: Deploy Site
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "**.yml"
workflow_dispatch:
jobs:
deploy:
name: Upload to Amazon S3
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set AWS credentials using preconfigured role and policy
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: us-west-2
- name: Copy files to the website bucket with the AWS CLI
run: |
aws s3 sync . s3://${{ secrets.AWS_BUCKET }} --exclude ".git*" --exclude "README.md"
- name: Create CloudFront invalidation with the AWS CLI
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION }} --paths "/*"