49 lines
1.2 KiB
YAML
49 lines
1.2 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: ubuntu-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: Install s3cmd
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y s3cmd
|
|
|
|
- name: Configure s3cmd for Scaleway
|
|
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
|
|
run: |
|
|
s3cmd sync --delete-removed --acl-public public/ s3://${{ secrets.SCW_BUCKET_NAME }}/
|