-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.52 KB
/
deploy-functions.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
name: 'build and deploy serverless functions'
on:
push:
paths:
- server/**
- .github/workflows/deploy-functions.yaml
jobs:
build-server-and-deploy:
name: 'Build typescript, bundle with esbuild, and deploy to digital ocean'
runs-on: ubuntu-latest
steps:
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Install doctl serverless support
run: doctl serverless install && doctl serverless connect find-directors
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: pnpm
cache-dependency-path: 'server/pnpm-lock.yaml'
- name: Install dependencies
run: pnpm install
working-directory: server
- name: Compile server typescript
run: pnpm run build:types
working-directory: server
- name: Test functions
env:
CH_API_KEY: ${{ secrets.CH_API_KEY }}
run: pnpm run test >> $GITHUB_STEP_SUMMARY
working-directory: server
- name: Build functions
run: pnpm run build:functions >> $GITHUB_STEP_SUMMARY
working-directory: server
- name: Deploy functions
run: pnpm run deploy >> $GITHUB_STEP_SUMMARY
env:
CH_API_KEY: ${{ secrets.CH_API_KEY }}
working-directory: server