-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.17 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
38
39
40
41
42
name: Blog Workflow
on:
push:
branches:
- material
jobs:
build:
runs-on: macOS-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Initial Environment
env:
SSH_KEY: ${{secrets.SSH_KEY}}
SSH_USER: ${{secrets.SSH_USER}}
SSH_IP: ${{secrets.SSH_IP}}
SSH_PORT: ${{secrets.SSH_PORT}}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
printf "Host blog\n HostName $SSH_IP\n User $SSH_USER\n Port $SSH_PORT" > ~/.ssh/config
{ ssh-keyscan -p $SSH_PORT $SSH_IP 2> /dev/null; } >> ~/.ssh/known_hosts
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Configuration Environment
run: |
git submodule sync
git submodule update --init
- name: Install dependencies
run: |
npm i yarn -g
yarn global add gulp
yarn install && gulp
rsync -az -v --delete public/* blog:/etc/nginx/blog/