Skip to content

Merge pull request #131 from BlazeFace/dependabot/npm_and_yarn/svelte… #187

Merge pull request #131 from BlazeFace/dependabot/npm_and_yarn/svelte…

Merge pull request #131 from BlazeFace/dependabot/npm_and_yarn/svelte… #187

Workflow file for this run

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 }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
cache: 'npm'
- name: Copy to .env
run: |
state=$(cat state.yaml)
printf "PUBLIC_STATE=\"\n$state\"" > .env
- run: npm ci
- run: npx playwright install
- run: npm run build --if-present
- run: npm 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 cdn endpoint purge --content-paths "/*" --profile-name blzai-static --name blzai --resource-group blz.ai --output none
# Azure logout
- name: logout
run: |
az logout
if: always()