hsa-app/.forgejo/workflows/deploy.yml
Jean-Michel Tremblay fafd763d99
All checks were successful
Build and Test / build-and-test (push) Successful in 34s
Split deploy: auto-stage on tag, manual activate via button
build.yml now only stages the binary into ~/hsa-app/releases on tag
(no symlink swap or restart). Activation is a separate workflow_dispatch
workflow (deploy.yml) the user triggers from the Forgejo Actions tab,
passing the tag to point the symlink at and restart. Update INSTALL.md
to describe the stage/activate split.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 15:12:22 -04:00

24 lines
857 B
YAML

name: Deploy
on:
workflow_dispatch:
inputs:
tag:
description: 'Release version to activate, e.g. 0.0.0a1 (must already be staged in ~/hsa-app/releases/hsa-app-V<tag>/hsa)'
required: true
jobs:
deploy:
runs-on: shell
steps:
- name: Activate release
run: |
echo "${{ secrets.FORGEJO_SSH }}" > /tmp/deploy_key
chmod 600 /tmp/deploy_key
TAG=${{ github.event.inputs.tag }}
TARGET=${{ vars.HSA_APP_USER }}@${{ vars.HSA_APP_HOST }}
ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no $TARGET \
"cd hsa-app \
&& test -f releases/hsa-app-V$TAG/hsa \
&& chmod +x releases/hsa-app-V$TAG/hsa \
&& ln -sfn releases/hsa-app-V$TAG/hsa hsa \
&& systemctl --user restart hsa_app"
rm /tmp/deploy_key