From ebf7a68bc9bc6f1815d9c4392e5d89bbc6bd2942 Mon Sep 17 00:00:00 2001 From: Thies Lennart Alff Date: Mon, 8 Aug 2022 09:03:25 +0200 Subject: [PATCH] added github workflow for build and deploy --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..72f0faf --- /dev/null +++ b/.github/workflows/build.yml @@ -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 }} + +