fgo-ta-com-website/.forgejo/workflows/redeploy.yml
Firq 01f407440c
All checks were successful
/ checking (push) Successful in 17s
/ build-site (push) Successful in 28s
/ deploy-site (push) Successful in 9s
test manual
2023-12-19 23:52:54 +01:00

32 lines
1.1 KiB
YAML

on: workflow_dispatch
jobs:
redeploy-site:
runs-on: docker
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
steps:
- name: Install and update ssh + rsync
run: |
which rsync || ( apt update -y && apt install rsync -y)
which ssh-agent || ( apt update -y && apt install openssh-client -y)
- name: Install SSH Key
uses: https://github.com/shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: unnecessary
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
- name: Restart screen session
uses: https://github.com/appleboy/ssh-action@master
with:
host: ${{ env.DEPLOY_HOST }}
username: ${{ env.DEPLOY_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
screen -X -S fgo-ta_com-public kill
PATH="$HOME/.local/bin:$PATH"
cd fgo-ta_com
screen -S fgo-ta_com-public -dm serve public/ -p ${{ secrets.DEPLOY_TARGET_PORT }}