From 8f6f0401ca0dd96d4093c76e1ab39cc5b31750b0 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 | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 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..b391d39 --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,44 @@ +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 + + - 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/