Update main_product-docs-prod.yml #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and deploy Node.js app to Azure Web App - product-docs-prod | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js version | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22.x' | |
| - name: Install dependencies and build site | |
| run: | | |
| npm ci | |
| npm run build | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=16384" | |
| - name: Install zip (if needed) | |
| run: sudo apt-get update && sudo apt-get install -y zip | |
| - name: Zip build directory | |
| run: zip -r build.zip build | |
| - name: Upload artifact for deployment job | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: node-app | |
| path: build.zip | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Download artifact from build job | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: node-app | |
| - name: Unzip artifact | |
| run: unzip build.zip | |
| - name: Login to Azure | |
| uses: azure/login@v2 | |
| with: | |
| client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_A214A3C0191244938C1F540AE0784B17 }} | |
| tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_5CCF304AF9F843A583AEF7B0F81ECA5F }} | |
| subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_46445F312B66482C990DC764E4218175 }} | |
| - name: Deploy to Azure Web App | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: 'product-docs-prod' | |
| slot-name: 'Production' | |
| package: build |