-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (36 loc) · 1.37 KB
/
deploy.yml
File metadata and controls
40 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# This is a basic workflow to help you get started with Actions
name: Deploy to Production
# Controls when the action will run.
#on:
# workflow_run:
# workflows: [ "Switcharoohelper Unit Tests" ]
# branches: [ master ]
# types:
# - completed
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
on-success:
# The type of runner that the job will run on
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: SSH Remote Commands
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
whoami
systemctl --user stop switcharoo_main.service
cd ~/switcharoo
git pull origin master
cp ~/switcharoo/config/services/* ~/.config/systemd/user
python3 -m poetry install --sync
echo "${{ secrets.CONFIG }}" > ~/switcharoo/credentials.ini
crontab ~/switcharoo/config/cron.jobs
systemctl --user daemon-reload
systemctl --user start switcharoo_main.service