added github workflow for build and deploy

This commit is contained in:
Thies Lennart Alff 2022-08-08 09:03:25 +02:00
parent 6bf88e4267
commit ebf7a68bc9

36
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,36 @@
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 }}