34 lines
721 B
YAML
34 lines
721 B
YAML
name: Build and Deploy Hugo
|
|
|
|
on:
|
|
pull_request:
|
|
types: [closed]
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build_and_deploy:
|
|
if: github.event.pull_request.merged == true
|
|
name: Deploy Hugo Website
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v2.6.0
|
|
with:
|
|
hugo-version: "0.108.0"
|
|
|
|
- name: Build site
|
|
run: hugo
|
|
|
|
- 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 }}
|