forked from Itera/graduate-case-base
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.61 KB
/
build-and-deploy-webapp-restaurant.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
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build and deploy restaurant web
run-name: Build and deploy restaurant web
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'restaurant/web/**'
env:
WEB_APP_LOCATION: restaurant/web
WEB_APP_ARTIFACT_LOCATION: dist # relative to WEB_APP_LOCATION
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
- name: Install dependencies
shell: bash
working-directory: ${{ env.WEB_APP_LOCATION }}
run: |
npm ci
- name: Build project
shell: bash
working-directory: ${{ env.WEB_APP_LOCATION }}
run: |
npm run build
deploy-dev:
needs: [build]
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.azure_credentials }}
- name: Build and Deploy web app
uses: Azure/static-web-apps-deploy@v1
env:
VITE_AUTH_CLIENT_ID: ${{ vars.VITE_AUTH_CLIENT_ID_RESTAURANT }}
VITE_API_BASE_URL: ${{ vars.VITE_API_BASE_URL_RESTAURANT }}
VITE_API_SCOPE: ${{ vars.VITE_API_SCOPE_RESTAURANT }}
with:
azure_static_web_apps_api_token: ${{ secrets.WEBAPP_DEPLOYMENT_TOKEN_RESTAURANT }}
repo_token: ${{ secrets.github_token }}
action: "upload"
app_location: ${{ env.WEB_APP_LOCATION }}
app_artifact_location: ${{ env.WEB_APP_ARTIFACT_LOCATION }}