lennartalff.net/.github/workflows/build.yml
2022-08-08 09:37:50 +02:00

36 lines
885 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_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
remote_key_pass: ${{ secrets.DEPLOY_KEY_PASS }}