From bebe52f22e41365b1db1d4d0175d81d23ce82094 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Tue, 4 Jul 2023 12:32:24 +0000 Subject: [PATCH] Ajouter .gitea/workflows/production.yaml --- .gitea/workflows/production.yaml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitea/workflows/production.yaml diff --git a/.gitea/workflows/production.yaml b/.gitea/workflows/production.yaml new file mode 100644 index 0000000..4e7e71e --- /dev/null +++ b/.gitea/workflows/production.yaml @@ -0,0 +1,38 @@ +name: Production + +on: + push: + tags: + - '*' + +jobs: + build_and_deploy_prod: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: https://github.com/actions/checkout@v3 + + - name: Install hugo + run: | + apt-get update -y + apt-get install hugo -y + + - name: Init submodules + run: git submodule update --init + + - name: Check Hugo version + run: hugo version + + - name: Build production + run: hugo --gc --minify -b https://blog.broillet.ch/ + + - name: Copy (scp) prod build to blog server + uses: https://github.com/garygrossgarten/github-action-scp@release + with: + local: 'public' + remote: /var/www/html/prod + host: ${{ secrets.SSH_HOSTNAME }} + username: 'root' + privateKey : ${{ secrets.SSH_KEY }} + rmRemote: true + dotfiles: true \ No newline at end of file