Skip to content

Commit bc992eb

Browse files
committed
add deployment on s3 scaleway
1 parent 0f7e2f2 commit bc992eb

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

.github/workflows/static.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install the dependencies
3232
run: npm ci
3333
- name: Build
34-
run: npm run build
34+
run: npm run build
3535
- name: Upload artifact
3636
uses: actions/upload-pages-artifact@v3
3737
with:
@@ -51,4 +51,35 @@ jobs:
5151
steps:
5252
- name: Deploy to GitHub Pages
5353
id: deployment
54-
uses: actions/deploy-pages@v4
54+
uses: actions/deploy-pages@v4
55+
56+
deploy-s3:
57+
needs: build
58+
# if: github.ref == 'refs/heads/master'
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
64+
- name: Install s3cmd
65+
run: sudo apt-get update && sudo apt-get install -y s3cmd
66+
67+
- name: Configure s3cmd
68+
run: |
69+
mkdir -p ~/.config/s3cmd
70+
cat > ~/.s3cfg <<EOF
71+
[default]
72+
access_key = ${{ secrets.S3_ACCESS_KEY }}
73+
secret_key = ${{ secrets.S3_SECRET_KEY }}
74+
host_base = s3.fr-par.scw.cloud
75+
host_bucket = %(bucket)s.s3.fr-par.scw.cloud
76+
use_https = True
77+
EOF
78+
79+
- name: Sync build to S3
80+
run: |
81+
s3cmd sync build/ s3://quantstack-site/ --acl-public \
82+
--mime-type=text/css --exclude '*' --include '*.css'
83+
s3cmd sync build/ s3://quantstack-site/ --acl-public \
84+
--mime-type=application/javascript --exclude '*' --include '*.js'
85+
s3cmd sync build/ s3://quantstack-site/ --acl-public --exclude '*.css' --exclude '*.js'

0 commit comments

Comments
 (0)