-
Notifications
You must be signed in to change notification settings - Fork 502
58 lines (56 loc) · 1.82 KB
/
website-deploy-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
name: Build & Deploy to Preview
on: [push]
jobs:
build:
if: github.repository == 'microsoft/Microsoft365DSC' && github.event.ref == 'refs/heads/Dev'
runs-on: ubuntu-latest
environment:
name: PREVIEW
name: Build
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-node@v3
with:
node-version: "16"
- name: Generate workloads and resources
shell: pwsh
run: pwsh -command ".\$GITHUB_WORKSPACE\generator\scripts\Build-Workloads.ps1 -Force"
- name: Install packages
run: |
cd ${GITHUB_WORKSPACE}/generator
npm install --force
- name: Build generator
run: |
cd ${GITHUB_WORKSPACE}/generator
npm run build
env:
REACT_APP_SITE_DESCRIPTION: ${{ secrets.REACT_APP_SITE_DESCRIPTION }}
REACT_APP_INSTRUMENTATION_KEY: ${{ secrets.REACT_APP_INSTRUMENTATION_KEY }}
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: website-build
path: ${{ github.workspace }}/generator/build
deploy_preview:
if: github.repository == 'microsoft/Microsoft365DSC' && github.event.ref == 'refs/heads/Dev'
runs-on: ubuntu-latest
environment:
name: PREVIEW
name: Deploy to Preview
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: website-build
- name: Deploy to Preview Azure Static Web App
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
app_location: ""
output_location: ""
skip_app_build: true