-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (62 loc) Β· 1.91 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
50
51
52
53
54
55
56
57
58
59
60
61
62
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
with:
submodules: 'true'
token: ${{ secrets.TW_CONFIDENTIAL_MATERIAL_PAT }}
- 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
environment: deploy_${{ matrix.site }}
strategy:
matrix:
site: [ teach, gbsl ]
steps:
# TODO #5: Cache checkout / node setup / yarn install
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'true'
token: ${{ secrets.TW_CONFIDENTIAL_MATERIAL_PAT }}
- 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 }} yarn run build
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
TENANT_ID: ${{ secrets.TENANT_ID }}
APP_URL: ${{ secrets.APP_URL }}
BACKEND_URL: ${{ secrets.BACKEND_URL }}
API_URI: ${{ secrets.API_URI }}
- 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 }}