-
Notifications
You must be signed in to change notification settings - Fork 196
54 lines (44 loc) · 1.43 KB
/
deploy-preview.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
45
46
47
48
49
50
51
52
53
54
name: Build and Deploy to preview
on:
push:
branches:
- 'versions/3.0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
BASE_URL: https://dev.nightwatchjs.org
REMOTE_SERVER: ${{ secrets.REMOTE_SERVER }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
API_DOCS_FOLDER: ${{ github.workspace }}/nightwatch/lib/api
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout Nightwatch source code
uses: actions/checkout@v2
with:
repository: nightwatchjs/nightwatch
path: nightwatch
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run eslint
run: npm run eslint
- name: Build the website
run: npm run build
- name: Creating symlinks to old version
run: |
ln -s ../nightwatchjs.org out/v17
ln -s ../v09.nightwatchjs.org out/v09
ln -s ../nightwatch-v26 out/v26
- name: Deploy to server
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PROD_DEPLOY_SECRET }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{ env.REMOTE_SERVER }} >> ~/.ssh/known_hosts
rsync -azP --delete ./out/ ${{ env.REMOTE_USER }}@${{ env.REMOTE_SERVER }}:${{ secrets.REMOTE_PREVIEW_DIRECTORY }}