Skip to content

modified deployment script. #3

modified deployment script.

modified deployment script. #3

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Node.js app to Azure Web App - typeagent
on:
push:
branches:
- dev/robgruen/android
workflow_dispatch:
jobs:
build_ts:
strategy:
fail-fast: false
matrix:
os: ["windows-latest"]
#os: ["ubuntu-latest", "windows-latest", "macos-latest"]
#version: [18, 20]
version: [20]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Git LF
run: |
git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ts:
- "ts/**"
- ".github/workflows/build-ts.yml"
- uses: pnpm/action-setup@v4
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
name: Install pnpm
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
with:
node-version: ${{ matrix.version }}
cache: "pnpm"
cache-dependency-path: ts/pnpm-lock.yaml
- name: Install dependencies
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
working-directory: ts
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies
- name: Build
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
working-directory: ts
run: |
npm run build
- name: Test
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
working-directory: ts
run: |
npm run test
- name: Lint
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.ts == 'true' }}
working-directory: ts
run: |
npm run lint
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: ./ts
deploy:
runs-on: ubuntu-latest
needs: build_ts
environment:
name: 'test'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: node-app
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_B4797564A45B4B2CAEF5F113E8617853 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_0611664DD86346ACAAB76A0B1D0581EE }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_D685C18460584CADB3CABB18FCA57D30 }}
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v3
id: deploy-to-webapp
with:
app-name: 'typeagent'
slot-name: 'test'
package: .