From 4372dae142c17f5ae2b12ae8a91e5e65644df82a Mon Sep 17 00:00:00 2001 From: darnodo Date: Wed, 19 Nov 2025 17:52:31 +0100 Subject: [PATCH] Refactor Hugo deploy workflow The deployment workflow was rewritten to use Hugo's built-in deploy feature. This simplifies the overall process and removes external dependencies. --- .gitea/workflows/deploy.yml | 56 +++++++++---------------------------- 1 file changed, 13 insertions(+), 43 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 485aa11..d06da65 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: Deploy to Scaleway +name: Build and Deploy Hugo on: pull_request: @@ -7,57 +7,27 @@ on: - main jobs: - build-and-deploy: + build_and_deploy: if: github.event.pull_request.merged == true - runs-on: self-hosted - - container: - image: node:20-bookworm + name: Deploy Hugo Website + runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: submodules: recursive - fetch-depth: 0 - name: Setup Hugo - uses: peaceiris/actions-hugo@v2 + uses: peaceiris/actions-hugo@v2.6.0 with: - hugo-version: "latest" - extended: true + hugo-version: "0.108.0" - - name: Build Hugo site - run: hugo --minify + - name: Build site + run: hugo - - name: Install AWS CLI - run: | - apt-get update - apt-get install -y awscli - - - name: Deploy to Object Storage - run: | - aws configure set default.s3.signature_version s3v4 - aws s3 sync public/ s3://notebook-arnodo-fr/ \ - --endpoint-url=https://s3.fr-par.scw.cloud \ - --region=fr-par \ - --delete + - name: Deploy to S3 + run: hugo deploy --force --maxDeletes -1 env: - AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_KEY }} - AWS_DEFAULT_REGION: fr-par - - - 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 }} - SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} - SCW_DEFAULT_REGION: fr-par - run: | - export PATH="$HOME/.scw/bin:$PATH" - scw edge-services pipeline purge pipeline-id=${{ secrets.SCW_PIPELINE_ID }} + AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_ACCESS_KEY }} -- 2.52.0