jmopines/.forgejo/workflows/build.yml
Jean-Michel Tremblay 4e77c20011
All checks were successful
Build Website / build (push) Successful in 1s
test
2026-04-20 09:47:50 -04:00

35 lines
No EOL
1.1 KiB
YAML

name: Build Website
on: [push]
jobs:
build:
runs-on: docker
steps:
- name: Checkout
run: |
git clone --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
- name: Prepare output directory
run: |
mkdir -p site/public
chmod 777 site
- name: Build
run: |
mkdir -p "$PWD/.hugo-cache"
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$PWD/site:/src" \
-v "$PWD/.hugo-cache:/cache" \
-e GOPATH=/cache \
-w /src \
ghcr.io/gohugoio/hugo:latest \
--minify --destination "public" --baseURL "/"
- name: Deploy
run: |
echo "${{ secrets.FORGEJO_SSH }}" > /tmp/deploy_key
chmod 600 /tmp/deploy_key
rsync -az --delete \
--exclude 'resume/' \
-e "ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no" \
site/public/. \
${{ vars.JMOPINES_USER }}@${{ vars.JMOPINES_IP }}:/var/www/jmopines/
rm /tmp/deploy_key