Skip to content

Commit c3e7969

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

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: Create s3cmd config
68+
run: |
69+
echo "[default]" > /home/runner/.s3cfg
70+
echo "access_key = ${{ secrets.SCW_ACCESS_KEY }}" >> /home/runner/.s3cfg
71+
echo "secret_key = ${{ secrets.SCW_SECRET_KEY }}" >> /home/runner/.s3cfg
72+
echo "host_base = s3.fr-par.scw.cloud" >> /home/runner/.s3cfg
73+
echo "host_bucket = %(bucket)s.s3.fr-par.scw.cloud" >> /home/runner/.s3cfg
74+
echo "use_https = True" >> /home/runner/.s3cfg
75+
76+
- name: Test s3cmd config
77+
run: s3cmd ls
78+
79+
- name: Sync build to S3
80+
run: |
81+
s3cmd sync build/ s3://quantstack-site/ --acl-public --exclude '*.css' --exclude '*.js'
82+
s3cmd sync build/ s3://quantstack-site/ --acl-public \
83+
--mime-type=text/css --exclude '*' --include '*.css'
84+
s3cmd sync build/ s3://quantstack-site/ --acl-public \
85+
--mime-type=application/javascript --exclude '*' --include '*.js'

0 commit comments

Comments
 (0)