From d2e750cc4ac8294298f176d801b37f0db2d51b10 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Mon, 3 Jul 2023 13:35:41 +0000 Subject: [PATCH] added gitea actions --- .gitea/workflows/build.yaml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..280ae00 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,44 @@ +name: Production + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: https://github.com/actions/checkout@v3 + submodules: true + + - name: Check Hugo version + run: hugo version + + - name: Build staging + run: hugo --gc --minify --buildDrafts -b https://blog.broillet.ch/ + + - name: Copy (scp) staging build to blog server + uses: https://github.com/appleboy/scp-action@v0.1.4 + with: + host: ${{ secrets.SSH_HOSTNAME }} + username: root + port: 22 + key: ${{ secrets.SSH_KEY }} + source: "public/*" + target: /var/www/html/staging/ + + - name: Build production + run: hugo --gc --minify -b https://blog.broillet.ch/ + + - name: Copy (scp) staging build to blog server + uses: https://github.com/appleboy/scp-action@v0.1.4 + with: + host: ${{ secrets.SSH_HOSTNAME }} + username: root + port: 22 + key: ${{ secrets.SSH_KEY }} + source: "public/*" + target: /var/www/html/prod/ \ No newline at end of file