-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (74 loc) · 1.85 KB
/
pages.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Node CI
on:
push:
branches:
- "main"
# Sets permissions of the GITHUB_TOKEN
permissions:
contents: write
id-token: write
deployments: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
cache: "npm"
- name: Prepare Environment
run: |
npm ci
env:
CI: true
- name: Run docusaurus
run: |
npm run build
env:
CI: true
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./build"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docusaurus
path: "./build"
# Deployment job
deploy-ssh:
name: Deploy to casparcg.com
environment:
name: casparcg.com
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v3
with:
name: docusaurus
path: build
- name: Upload
uses: SamKirkland/web-deploy@v1
with:
target-server: ${{secrets.DEPLOY_SSH_HOST}}
remote-user: ${{secrets.DEPLOY_SSH_USERNAME}}
private-ssh-key: ${{secrets.DEPLOY_SSH_KEY}}
destination-path: ${{secrets.DEPLOY_PATH}}
source-path: build/
rsync-options: -avvz
- name: Trigger cache-purge
uses: appleboy/[email protected]
with:
host: ${{secrets.DEPLOY_SSH_HOST}}
username: ${{secrets.DEPLOY_SSH_USERNAME}}
key: ${{secrets.DEPLOY_SSH_KEY}}
script: cache-purge