added github workflow for build and deploy
This commit is contained in:
parent
6bf88e4267
commit
ebf7a68bc9
1 changed files with 36 additions and 0 deletions
36
.github/workflows/build.yml
vendored
Normal file
36
.github/workflows/build.yml
vendored
Normal 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 }}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue