This commit is contained in:
44
.gitea/workflows/publish.yaml
Normal file
44
.gitea/workflows/publish.yaml
Normal file
@@ -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/
|
||||
Reference in New Issue
Block a user