-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (47 loc) · 1.68 KB
/
azure_static_create.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
name: Create Static Web App on Azure
on:
workflow_dispatch:
pull_request:
types: [labeled, opened]
jobs:
build-and-deploy:
if: ${{ github.event.label.name == 'deploy_test' && github.repository_owner == 'ui5-community' }}
runs-on: ubuntu-latest
steps:
- name: format branch name
run: echo "branch_name_local=$( echo "$GITHUB_HEAD_REF" | tr -dc '[:alnum:]\n\r')" >> $GITHUB_ENV
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Create Static Web App
uses: azure/CLI@v1
with:
azcliversion: 2.37.0
inlineScript: |
az staticwebapp create -n ${{ env.branch_name_local }} -g bestofui5
- name: Set env
run: echo "azuresecret=$(az staticwebapp secrets list --name ${{ env.branch_name_local }} --query "properties.apiKey" | tr -d '"')" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
submodules: true
- name: use node 16
uses: actions/setup-node@v2
with:
node-version: 16
- name: install
run: npm install
- name: build
run: npm run build
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ env.azuresecret }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
skip_api_build: true
skip_app_build: true
app_location: "docs" # App source code path
output_location: "" # Built app content directory - optional
is_static_export: true