hsa-app/.forgejo/workflows/deploy.yml

25 lines
857 B
YAML
Raw Normal View History

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