-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.32 KB
/
deploy-docs.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
name: Build and deploy through rsync
on:
push:
branches: ["production"]
env:
working-directory: ./packages/docs/
url: www.slimfact.app
jobs:
build:
name: Build and deploy production
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Creating .npmrc
run: |
cat > ~/.npmrc << EOF
//npm.simsus.tech/:_authToken=$SIMSUSTECH_NPM_TOKEN
EOF
env:
SIMSUSTECH_NPM_TOKEN: ${{ secrets.SIMSUSTECH_NPM_TOKEN }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: pnpm i
- name: Build
working-directory: ${{ env.working-directory }}
run: |
pnpm run build
- name: rsync deployments
uses: burnett01/[email protected]
with:
switches: -avzr --delete
path: ${{env.working-directory}}dist/static/
remote_path: /srv/${{env.url}}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}
- name: Remove .npmrc
run: rm ~/.npmrc