-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.84 KB
/
verify.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
name: Verify, Test & Deploy application
on:
push:
branches:
- "main"
pull_request:
types:
- "opened"
- "synchronize"
- "reopened"
jobs:
default:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
env:
NITRO_PRESET: azure
run: npm run build
- name: Test unit
run: npm run test:unit
- name: Test e2e
run: npm run test:e2e
- name: Deploy to Azure SWA (Preview)
if: github.ref != 'refs/heads/main'
env:
DEPLOYMENT_TOKEN: ${{ secrets.SWA_CLI_DEPLOYMENT_TOKEN }}
SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
APP_NAME: ${{ secrets.SWA_CLI_APP_NAME }}
RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
run: npx @azure/static-web-apps-cli deploy ./.output/public --app-location ./packages/frontend --api-location ./packages/frontend/.output/server --env preview
- name: Deploy to Azure SWA (Production)
if: github.ref == 'refs/heads/main'
env:
DEPLOYMENT_TOKEN: ${{ secrets.SWA_CLI_DEPLOYMENT_TOKEN }}
SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
APP_NAME: ${{ secrets.SWA_CLI_APP_NAME }}
RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
run: npx @azure/static-web-apps-cli deploy ./.output/public --app-location ./packages/frontend --api-location ./packages/frontend/.output/server --env production