forked from ant-media/ant-media-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (29 loc) · 1.03 KB
/
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
on:
push:
branches:
- master
workflow_dispatch:
jobs:
run_pull:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sed -i "s^baseUrl:.*^baseUrl:'/docs',^" docusaurus.config.js
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: npm install
- run: npm run build
- run: cd build && tar -zcvf ../docs.tar .
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts
- name: connect and upload
run: |
scp -r docs.tar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}":"
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "find /home/antmedia.io/public_html/docs/ -type f -not -name "*.tar" -not -path "/home/antmedia.io/public_html/docs/.ssh/*" -exec rm {} \; && tar -zxvf docs.tar && rm -rf docs.tar"
- name: cleanup
run: rm -rf ~/.ssh