11# Simple workflow for deploying static content to GitHub Pages
22name : Deploy static content to Pages
33
4+ # on:
5+ # # Runs on pushes targeting the default branch
6+ # push:
7+ # branches: ["master"]
8+ # pull_request:
9+ # branches:
10+ # - '*'
411on :
5- # Runs on pushes targeting the default branch
612 push :
7- branches : ["master"]
8- pull_request :
913 branches :
10- - ' *'
14+ - ' ** '
1115
1216# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1317
3135 - name : Install the dependencies
3236 run : npm ci
3337 - name : Build
34- run : npm run build
38+ run : npm run build
3539 - name : Upload artifact
3640 uses : actions/upload-pages-artifact@v3
3741 with :
5155 steps :
5256 - name : Deploy to GitHub Pages
5357 id : deployment
54- uses : actions/deploy-pages@v4
58+ uses : actions/deploy-pages@v4
59+
60+ deploy-s3 :
61+ needs : build
62+ # if: github.ref == 'refs/heads/master'
63+ runs-on : ubuntu-latest
64+ steps :
65+ - name : Checkout
66+ uses : actions/checkout@v4
67+
68+ - name : Install s3cmd
69+ run : sudo apt-get update && sudo apt-get install -y s3cmd
70+
71+ - name : Create s3cmd config
72+ run : |
73+ echo "[default]" > /home/runner/.s3cfg
74+ echo "access_key = ${{ secrets.SCW_ACCESS_KEY }}" >> /home/runner/.s3cfg
75+ echo "secret_key = ${{ secrets.SCW_SECRET_KEY }}" >> /home/runner/.s3cfg
76+ echo "host_base = s3.fr-par.scw.cloud" >> /home/runner/.s3cfg
77+ echo "host_bucket = %(bucket)s.s3.fr-par.scw.cloud" >> /home/runner/.s3cfg
78+ echo "use_https = True" >> /home/runner/.s3cfg
79+
80+ - name : Sync build to S3
81+ run : |
82+ s3cmd sync build/ s3://quantstack-site/ --acl-public \
83+ --delete-removed --exclude '*.css' --exclude '*.js' --force
84+ s3cmd sync build/ s3://quantstack-site/ --acl-public \
85+ --mime-type=text/css --exclude '*' --include '*.css' --force
86+ s3cmd sync build/ s3://quantstack-site/ --acl-public \
87+ --mime-type=application/javascript --exclude '*' --include '*.js' --force
88+
89+ - name : Ensure public ACL
90+ run : s3cmd setacl s3://quantstack-site/ --acl-public --recursive
0 commit comments