forked from Polytoria/Docs
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (28 loc) · 919 Bytes
/
deploy.yml
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
name: Deploy
on:
push:
branches: main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ^3.12.3
cache: pip
- name: Install dependencies
run: pip install -r requirements.txt
- name: Configure SSH keys
run: |
mkdir -m 700 ~/.ssh
echo "${{ secrets.KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa -p ${{ secrets.PORT }} ${{ secrets.HOST }} > ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
- name: Build for production
run: mkdocs build -s
- name: Sync to production
run: rsync -ae "ssh -p ${{ secrets.PORT }}" --zc zstd --zl 19 --delete site/ ${{ secrets.USER }}@${{ secrets.HOST }}:${{ secrets.DEST }}