Files
Notebook/.gitea/workflows/deploy.yml
darnodo 6c5debee3f Install AWS CLI and deploy with S3 sync
The Hugo native deployment was not working correctly with the Scaleway
object storage. This commit installs the AWS CLI and uses `aws s3 sync`
instead.
2025-11-19 17:12:35 +01:00

61 lines
1.6 KiB
YAML

name: Deploy to Scaleway
on:
pull_request:
types: [closed]
branches:
- main
jobs:
build-and-deploy:
if: github.event.pull_request.merged == true
runs-on: self-hosted
container:
image: node:20-bookworm
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"
extended: true
- name: Build Hugo site
run: hugo --minify
- name: Install AWS CLI
run: |
apt-get update
apt-get install -y awscli
- name: Deploy to Object Storage
run: |
aws s3 sync public/ s3://notebook-arnodo-fr/ \
--endpoint-url=https://s3.fr-par.scw.cloud \
--delete
env:
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_ACCESS_KEY }}
- name: Install Scaleway CLI (for Purge only)
run: |
curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sh
export PATH="$HOME/.scw/bin:$PATH"
scw version
- name: Purge CDN Cache (optional)
env:
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY_ID }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_ACCESS_KEY }}
SCW_DEFAULT_REGION: fr-par
run: |
export PATH="$HOME/.scw/bin:$PATH"
scw edge-services pipeline purge pipeline-id=${{ secrets.SCW_PIPELINE_ID }}