47 lines
1.1 KiB
YAML
47 lines
1.1 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: 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"
|
|
extended: true
|
|
|
|
- name: Build Hugo site
|
|
run: hugo --minify
|
|
|
|
- name: Configure Scaleway CLI
|
|
run: |
|
|
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: |
|
|
scw object cp public/ s3://notebook-arnodo-fr/ --recursive
|
|
|
|
- name: Purge CDN Cache (optional)
|
|
run: |
|
|
scw edge-services pipeline purge pipeline-id=${{ secrets.SCW_PIPELINE_ID }}
|