37 lines
935 B
YAML
37 lines
935 B
YAML
name: "Build and Deploy"
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
jobs:
|
|
Build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 0
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v2
|
|
with:
|
|
hugo-version: 'latest'
|
|
- name: Build
|
|
run: hugo --minify
|
|
- name: Deploy
|
|
uses: burnett01/rsync-deployments@5.2.1
|
|
if: github.ref == 'refs/heads/main'
|
|
with:
|
|
switches: -avzr --delete
|
|
path: public/
|
|
remote_path: ${{ secrets.DEPLOY_PATH }}
|
|
remote_host: ${{ secrets.DEPLOY_HOST }}
|
|
remote_port: ${{ secrets.DEPLOY_PORT }}
|
|
remote_user: ${{ secrets.DEPLOY_USER }}
|
|
remote_key: ${{ secrets.DEPLOY_KEY }}
|
|
remote_key_pass: ${{ secrets.DEPLOY_KEY_PASS }}
|
|
|
|
|