www/.forgejo/workflows/main.yaml
Julien Dessaux 5fd3dc0a53
All checks were successful
/ all (push) Successful in 8s
fix(tooling): fix workflow steps ordering
2025-03-16 23:39:39 +01:00

36 lines
1.1 KiB
YAML

---
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
all:
runs-on: 'self-hosted'
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-go@v5'
with:
go-version-file: 'search/go.mod'
- name: 'fmt'
run: |
make tidy no-dirty
- name: 'build'
run: |
make build
# we need the build step done before the go checks can run because we need
# the index.html file generated by the hugo build
- name: 'check'
run: |
make check no-dirty
- name: 'deploy'
run: |
umask 077
printf '%s' "$SSH_PRIVATE_KEY" | base64 -d > private_key
SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new"
rsync -a --delete -e "ssh ${SSHOPTS}" public/ www@www.adyxax.org:/srv/www/public/
rsync -e "ssh ${SSHOPTS}" search/search www@www.adyxax.org:/srv/www/
ssh ${SSHOPTS} www@www.adyxax.org "chmod +x search; systemctl --user restart www-search"
env:
SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}'