Deploy website to Scaleway Object Storage
Some checks failed
Deploy to Scaleway / build-and-deploy (pull_request) Has been cancelled

Use Scaleway CLI and replace s3cmd. Add CDN cache purge (optional).
Remove GitHub Pages workflow.
This commit is contained in:
darnodo
2025-11-19 15:36:06 +01:00
parent d31d9e8eb3
commit 5460352a9b
2 changed files with 20 additions and 100 deletions

View File

@@ -9,40 +9,38 @@ on:
jobs:
build-and-deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
runs-on: gitea-runner
container:
image: scaleway/cli:latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
hugo-version: "latest"
extended: true
- name: Build Hugo site
run: hugo --minify
- name: Install s3cmd
- name: Configure Scaleway CLI
run: |
sudo apt-get update
sudo apt-get install -y s3cmd
- name: Configure s3cmd for Scaleway
scw init access-key=${{ secrets.SCW_ACCESS_KEY }} \
secret-key=${{ secrets.SCW_SECRET_KEY }} \
default-organization-id=${{ secrets.SCW_ORGANIZATION_ID }} \
default-region=fr-par
- name: Deploy to Object Storage
run: |
cat > ~/.s3cfg << EOF
[default]
access_key = ${{ secrets.SCW_ACCESS_KEY }}
secret_key = ${{ secrets.SCW_SECRET_KEY }}
host_base = s3.fr-par.scw.cloud
host_bucket = %(bucket)s.s3.fr-par.scw.cloud
use_https = True
EOF
- name: Deploy to Scaleway Object Storage
scw object cp public/ s3://notebook-arnodo-fr/ --recursive
- name: Purge CDN Cache (optional)
run: |
s3cmd sync --delete-removed --acl-public public/ s3://${{ secrets.SCW_BUCKET_NAME }}/
scw edge-services pipeline purge pipeline-id=${{ secrets.SCW_PIPELINE_ID }}