-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (38 loc) · 1.04 KB
/
build-website.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
name: Build Website
on:
push:
branches:
- main
# - ci
paths:
- ".github/**"
- "www/**"
pull_request:
workflow_dispatch:
jobs:
build-website:
name: Build Website
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: cd www && npm ci
- name: Build Website
run: cd www && npm run build
- name: Deploy
if: github.ref == 'refs/heads/main'
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
run: |
eval $(ssh-agent -s)
ssh-add <(echo "$SSH_DEPLOY_KEY")
mkdir -p ~/.ssh/
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
ssh [email protected] "rsync --version"
rsync -avz --delete www/build/ [email protected]:/var/www/oss.silitics.com/rugpi/