-
Notifications
You must be signed in to change notification settings - Fork 168
96 lines (96 loc) · 2.83 KB
/
api.yml
File metadata and controls
96 lines (96 loc) · 2.83 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: API
on:
push:
branches:
- main
paths:
- 'packages/api/**'
- '.github/workflows/api.yml'
- 'yarn.lock'
pull_request:
paths:
- 'packages/api/**'
- '.github/workflows/api.yml'
- 'yarn.lock'
jobs:
test:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: 'cp .env.tpl .env'
- run: yarn test:api:docker
deploy-dev:
name: Deploy Dev
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/main'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: bahmutov/npm-install@v1
- name: Publish app
if: env.CF_API_TOKEN
uses: cloudflare/wrangler-action@1.3.0
env:
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
CF_API_TOKEN: ${{secrets.CF_API_TOKEN}}
with:
apiToken: ${{secrets.CF_API_TOKEN }}
workingDirectory: packages/api
deploy-staging:
name: Deploy Staging
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- uses: bahmutov/npm-install@v1
- name: Publish app
uses: cloudflare/wrangler-action@1.3.0
env:
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
with:
apiToken: ${{secrets.CF_API_TOKEN }}
workingDirectory: 'packages/api'
environment: 'staging'
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Release
runs-on: ubuntu-latest
needs: test
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: tag-release
with:
path: packages/api
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
monorepo-tags: true
package-name: api
- uses: actions/checkout@v2
if: ${{ steps.tag-release.outputs.releases_created }}
- uses: actions/setup-node@v2
if: ${{ steps.tag-release.outputs.releases_created }}
with:
node-version: '16'
registry-url: https://registry.npmjs.org/
- uses: bahmutov/npm-install@v1
if: ${{ steps.tag-release.outputs.releases_created }}
- uses: cloudflare/wrangler-action@1.3.0
if: ${{ steps.tag-release.outputs.releases_created }}
env:
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: 'packages/api'
environment: 'production'