From 74faf3bcad81e60b2a8630d90319fb1c1182a379 Mon Sep 17 00:00:00 2001 From: kamkow1 Date: Wed, 31 Dec 2025 23:32:39 +0100 Subject: [PATCH] CI publish workflow --- .gitea/workflows/publish.yaml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .gitea/workflows/publish.yaml diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..6f3b2e3 --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,45 @@ +name: Build website + +on: + push: + branches: + - master + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + + - name: Install JBake + run: | + JBAKE_VERSION=2.7.0 + curl -L -o jbake.zip https://github.com/jbake-org/jbake/releases/download/v${JBAKE_VERSION}/jbake-${JBAKE_VERSION}-bin.zip + unzip jbake.zip + sudo mv jbake-${JBAKE_VERSION}-bin /opt/jbake + sudo ln -s /opt/jbake/bin/jbake /usr/local/bin/jbake + jbake --version + + - name: Build website + run: | + jbake -b + + - name: Deploy + env: + SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + REMOTE_IP: ${{ vars.DEPLOY_REMOTE_IP }} + run: | + mkdir -p ~/.ssh + echo "$SSH_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -H "$REMOTE_IP" >> ~/.ssh/known_hosts + chmod -R 777 output + rsync -az --delete output/ webuser@"$REMOTE_IP":/home/webuser/www/