name: Build website on: push: branches: - master jobs: build-and-deploy: runs-on: ubuntu-latest container: image: jbake/jbake:latest steps: - name: Check out repository uses: actions/checkout@v4 - 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/