fixed package-lock mismatch #23
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 Docusaurus site to Azure Web App - product-docs-prod | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Check out source code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '22.x' | |
| - name: Cache Node.js dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies and build site | |
| run: | | |
| npm ci | |
| npm run build | |
| env: | |
| NODE_OPTIONS: "--max-old-space-size=16384" | |
| DOCUSAURUS_URL: "https://product-docs-prod-hdhbe6h2hddcghd7.eastus2-01.azurewebsites.net" | |
| - name: Install zip (if needed) | |
| run: sudo apt-get update && sudo apt-get install -y zip | |
| - name: Zip contents of build/ for Azure run-from-package | |
| run: | | |
| cd build | |
| zip -r ../build.zip . | |
| cd .. | |
| - name: Upload artifact for deployment | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-zip | |
| path: build.zip | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Download build artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: 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 build.zip to Azure Web App | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: 'product-docs-prod' | |
| slot-name: 'Production' | |
| package: build.zip |