-
Notifications
You must be signed in to change notification settings - Fork 4
26 lines (24 loc) · 952 Bytes
/
deploy.yml
File metadata and controls
26 lines (24 loc) · 952 Bytes
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
name: Publish
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy
env:
deploy_key: ${{secrets.deploy_key}}
known_hosts: ${{secrets.known_hosts}}
run: |
mkdir -p ${HOME}/.ssh
printf "%s\n" "$known_hosts" > ${HOME}/.ssh/known_hosts
printf "%s\n" "$deploy_key" > ${HOME}/.ssh/id_rsa
chmod 600 ${HOME}/.ssh/id_rsa
eval $(ssh-agent)
ssh-add
rsync -a ./ pydocteur-afpy-org@deb2.afpy.org:/home/pydocteur-afpy-org/src/
ssh pydocteur-afpy-org@deb2.afpy.org /home/pydocteur-afpy-org/venv/bin/python -m pip install --upgrade setuptools wheel pip
ssh pydocteur-afpy-org@deb2.afpy.org /home/pydocteur-afpy-org/venv/bin/python -m pip install -r /home/pydocteur-afpy-org/src/requirements.txt
ssh pydocteur-afpy-org@deb2.afpy.org systemctl --user restart pydocteur.service