-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.18 KB
/
gh-pages.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
39
40
41
42
43
44
# This is a basic workflow to help you get started with Actions
name: Build and deploy
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install and Build 🔧
run: |
cd web
yarn --no-interactive --frozen-lockfile
yarn run build
- name: Deploy
shell: bash
env:
RSYNC_DIR: ${{ secrets.RSYNC_DIR }}
RSYNC_HOST: ${{ secrets.RSYNC_HOST }}
RSYNC_KEY: ${{ secrets.RSYNC_KEY }}
RSYNC_USER: ${{ secrets.RSYNC_USER }}
run: |
SSH_PATH="~/.ssh"
KEY_FILE="$SSH_PATH/deploy_key"
mkdir -p "$SSH_PATH"
printf '%b\n' "$RSYNC_KEY" > "$KEY_FILE"
chmod 600 "$KEY_FILE"
eval "$(ssh-agent)"
ssh-add "$KEY_FILE"
cd web/build
rsync -av -e "ssh -o StrictHostKeyChecking=no" ./ "$RSYNC_USER"@"$RSYNC_HOST":"$RSYNC_DIR"