-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.29 KB
/
ci_cd.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
name: Testing and Deployment
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ hashFiles('package-lock.json') }}
- name: Installing
run: ./bin/install
- name: Static analysis
run: ./bin/npm run lint
- name: Type-Testing
run: ./bin/exec npx nuxi typecheck
deploy:
name: Deploy app
needs: lint
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v3
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ hashFiles('package-lock.json') }}
- name: Setup Fly
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Fly Deploy
run: flyctl deploy --remote-only --build-secret GOOGLE_MAPS_API_KEY="$GOOGLE_MAPS_API_KEY"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}