From 6ed5eedaeb803248d7286594e6ccd725269f317a Mon Sep 17 00:00:00 2001 From: MultiMote Date: Fri, 26 Apr 2024 15:37:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B5=D0=BF=D0=BB=D0=BE=D0=B9=20=D1=87?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B7=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build-and-deploy.yaml | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitea/workflows/build-and-deploy.yaml diff --git a/.gitea/workflows/build-and-deploy.yaml b/.gitea/workflows/build-and-deploy.yaml new file mode 100644 index 0000000..64f510e --- /dev/null +++ b/.gitea/workflows/build-and-deploy.yaml @@ -0,0 +1,46 @@ +name: Build and deploy mmote.ru +on: [push] + +jobs: + Build-And-Deploy: + runs-on: ubuntu-latest + steps: + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: '0.125.4' + extended: true + + - name: Setup SSH + run: | + mkdir ~/.ssh/ + echo "$HUGO_PRIVATE_KEY" > ~/.ssh/id_rsa + echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + chmod 600 ~/.ssh/id_rsa + shell: bash + env: + HUGO_PRIVATE_KEY: ${{secrets.HUGO_PRIVATE_KEY}} + SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}} + + - name: Checkout repository code + uses: actions/checkout@v3 + + - name: Insert commit data to sidebar + uses: jacobtomlinson/gha-find-replace@v3 + with: + include: "themes/mmotium/layouts/partials/sidebar.html" + find: "" + replace: | + Последний коммит: + + ${{gitea.event.head_commit.message}} + + regex: false + + - name: Hugo build + run: hugo + + - name: Deploy files to server + run: | + ssh hugo@mserver.lan rm -rf /var/www/mmote.ru/public + scp -r public/ hugo@mserver.lan:/var/www/mmote.ru/