-
Notifications
You must be signed in to change notification settings - Fork 174
41 lines (40 loc) · 1.45 KB
/
build.yaml
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
41
on:
push:
branches:
- 2022sp
pull_request:
branches:
- 2022sp
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 'Install Zola'
run: sudo snap install --edge zola
- name: 'Build Zola site'
run: zola build --drafts
- name: rsync
if: ${{github.event_name=='push' && github.ref=='refs/heads/2022sp'}}
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
DEPLOY_SRC: ./public/
DEPLOY_DEST: sync/cs6120-2022sp
DEPLOY_2_HOST: cslinux
DEPLOY_2_DEST: /courses/cs6120/2022sp/site
run: |
echo "$DEPLOY_KEY" > pk
echo "$DEPLOY_KNOWN_HOSTS" > kh
chmod 600 pk
rsync --compress --recursive --checksum --itemize-changes --delete \
-e "ssh -p \"$DEPLOY_PORT\" -i pk -o 'UserKnownHostsFile kh'" \
$DEPLOY_SRC $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_DEST
ssh -p $DEPLOY_PORT -i pk -o 'UserKnownHostsFile kh' \
$DEPLOY_USER@$DEPLOY_HOST \
rsync --compress --recursive --checksum --itemize-changes \
--delete -e ssh --perms --chmod=Du=rwx,Dgo=rx,Fu=rw,Fog=r \
$DEPLOY_DEST/ $DEPLOY_2_HOST:$DEPLOY_2_DEST