-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.44 KB
/
build.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
name: NodeJS Build
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Copy to .env
run: |
state=$(cat state.yaml)
printf "PUBLIC_STATE=\"\n$state\"" > .env
- run: pnpm install
- run: pnpm exec playwright install
- run: pnpm run build
- run: pnpm test
- name: Upload to blob storage
uses: azure/CLI@v2
with:
inlineScript: |
az storage blob upload-batch --account-name blzai --auth-mode login -d '$web' -s ./build --overwrite --output none
- name: Purge CDN endpoint
uses: azure/CLI@v2
with:
inlineScript: |
az afd endpoint purge --resource-group blz.ai --profile-name blzai-static --endpoint-name blzai --domains blz.ai www.blz.ai --content-paths '/*'
# Azure logout
- name: logout
run: |
az logout
if: always()