-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (49 loc) Β· 1.44 KB
/
check_build_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
43
44
45
46
47
48
49
name: Check, build and deploy
run-name: Running checks β
and deploying application π
on:
push:
branches:
- main
jobs:
checks:
runs-on: ubuntu-latest
name: Pre-deployment checks
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Yarn install
run: yarn install --frozen-lockfile
- name: Test
run: yarn run test
build_and_deploy_sites:
runs-on: ubuntu-latest
needs: checks
name: Build and deploy all sites
strategy:
matrix:
site: [ teach, gbsl, lerbermatt ]
steps:
# TODO #5: Cache checkout / node setup / yarn install
- name: Checkout
uses: actions/checkout@v4
- name: Node setup
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Yarn install
run: yarn install --frozen-lockfile
- name: Build for site ${{ matrix.site }}
run: SITE=${{ matrix.site }} npm run build
- name: RSync to webhost
uses: Burnett01/[email protected]
with:
switches: -avzr --delete
path: build/
remote_path: ~/sites/${{ matrix.site }}.silasberger.ch/
remote_host: ${{ secrets.WEBHOST_SSH_HOSTNAME }}
remote_user: ${{ secrets.WEBHOST_SSH_USERNAME }}
remote_key: ${{ secrets.WEBHOST_SSH_PRIVATE_KEY }}