-
Notifications
You must be signed in to change notification settings - Fork 9
27 lines (25 loc) · 932 Bytes
/
deploy-to-s3.yml
File metadata and controls
27 lines (25 loc) · 932 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
name: "[CI/CD] Deploy Static Site to S3"
on:
# pull_request: | TODO: add testing/validation
push:
branches:
- main
jobs:
deploy:
name: Sync to S3 static site
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1.6.1
with:
aws-region: ${{secrets.AWS_REGION}}
role-to-assume: ${{ secrets.AWS_OIDC_RUNNER_ROLE }}
- name: Sync to S3
run: | # Sync index and security txt, exclude hidden files; Sync assets and remove any that aren't in source
aws s3 sync . s3://pyscript.net/ --exclude ".*" --include ".well-known/security.txt" --include "index.html" --include "error.html" --include "mini-coi.js" --include "main.py"
aws s3 sync --delete assets/ s3://pyscript.net/assets/