-
Notifications
You must be signed in to change notification settings - Fork 287
91 lines (81 loc) · 2.93 KB
/
pwabuilder-preview.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
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
name: PWABuilder Preview CI/CD
on:
workflow_dispatch:
push:
branches:
- staging
paths:
- "apps/pwabuilder/**"
- "libraries/manifest-validation/**"
- "libraries/site-analytics/**"
- "components/code-editor/**"
- "components/manifest-editor/**"
- "components/manifest-previewer/**"
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- staging
paths:
- "apps/pwabuilder/**"
- "libraries/manifest-validation/**"
- "libraries/site-analytics/**"
- "components/code-editor/**"
- "components/manifest-editor/**"
- "components/manifest-previewer/**"
jobs:
build_and_deploy_job:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/pwabuilder
name: Build and Deploy Job
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_VITE_CLIENT_ID: ${{ secrets.MSAL_CLIENT_ID }}
file_name: .env
directory: apps/pwabuilder
- name: 🛠️ Build
run: |
npm install
npm run build
- name: 🚀 Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_GLACIER_097FE8710 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
app_location: "apps/pwabuilder/dist"
skip_app_build: true # Skip building the app using the default build commands for the specified app framework - optional
output_location: "" # Built app content directory - optional
generate_release:
runs-on: ubuntu-latest
name: Generate Release including changelog
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.CHANGELOG_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Staging Build"
close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_GLACIER_097FE8710 }}
action: "close"