-
Notifications
You must be signed in to change notification settings - Fork 10
37 lines (35 loc) · 1 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
33
34
35
36
37
name: deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'
- name: Install Node modules
run: npm install
- name: Eleventy
run: |
npx eleventy --output='_site/' --pathprefix='/'
- name: Deploy
run: |
mkdir -p ~/.ssh
chmod 0700 ~/.ssh
cat > ~/.ssh/key <<EOF
${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
EOF
cat > ~/.ssh/known_hosts <<EOF
${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }}
EOF
chmod 0600 ~/.ssh/{key,known_hosts}
rsync -e "ssh -p ${{ secrets.DEPLOY_REMOTE_PORT }} -i '$HOME/.ssh/key'" \
-azz --info=stats2 _site/ \
'${{ secrets.DEPLOY_REMOTE_USER }}@${{ secrets.DEPLOY_REMOTE_HOST }}:${{ secrets.DEPLOY_REMOTE_PATH }}'