Add Forgejo Actions workflow for build and deploy
Triggers on push to main: checks out repo with submodules, installs Zola, builds the site, and deploys to skippy via rsync.
This commit is contained in:
parent
f57d3d945d
commit
bb5c240aab
1 changed files with 33 additions and 0 deletions
33
.forgejo/workflows/deploy.yml
Normal file
33
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Zola
|
||||
run: |
|
||||
ZOLA_VERSION="0.19.2"
|
||||
wget -q "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" -O /tmp/zola.tar.gz
|
||||
tar -xzf /tmp/zola.tar.gz -C /usr/local/bin
|
||||
zola --version
|
||||
|
||||
- name: Build
|
||||
run: zola build
|
||||
|
||||
- name: Deploy via rsync
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
ssh-keyscan -H skippy.w5isp.com >> ~/.ssh/known_hosts
|
||||
rsync -avz --delete public/ graham@skippy.w5isp.com:/home/graham/apps/w5isp.com/
|
||||
Loading…
Add table
Reference in a new issue