Skip to content

Modernize Github action build/deploy script #1

Modernize Github action build/deploy script

Modernize Github action build/deploy script #1

name: Build and deploy web site
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.68.3'
# extended: true
- name: Build
run: hugo --minify
- name: Deploy site
if: github.ref == 'refs/heads/main'
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |
eval $(ssh-agent -s)
ssh-add - <<< "${SSH_KEY}"
rsync --exclude=/w --delete -r -e "ssh -o StrictHostKeyChecking=no -p 22" public/ [email protected]:/