Merge pull request #613 from microsoft/dependabot/npm_and_yarn/eslint… #425
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 the content | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| name: "Check it out" | |
| - name: "Startup" | |
| run: pwd | |
| - name: "Build the site" | |
| run: | | |
| npm install | |
| # For the Microsoft production site we integrate with 1DS telemetry. This is not a secret value. | |
| NEXT_ENV_DESCRIPTOR=production \ | |
| NEXT_ONE_DS_INSTRUMENTATION_KEY=b341ec446e65436485df678003ce82f7-1d36a7a4-ef54-4cf0-93eb-ba18b3241d36-7404 \ | |
| npm run build | |
| - name: "Stamp content.json" | |
| env: | |
| GITSHA: ${{ github.sha }} | |
| run: | | |
| echo "{\"commitId\":\"$GITSHA\"}" > content.json | |
| cat ./content.json | |
| cp content.json out/ | |
| - name: "Compress the static site" | |
| run: zip -r ../site.zip . | |
| working-directory: /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/out | |
| - uses: actions/upload-artifact@v4 | |
| name: "Store the site as an artifact" | |
| with: | |
| name: website | |
| path: /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/site.zip | |
| - name: "List site files" | |
| working-directory: /home/runner/work/opensource.microsoft.com/opensource.microsoft.com | |
| run: | | |
| ls -la site.zip content.json | |
| - uses: azure/cli@v2 | |
| name: "Upload to share via CLI (main)" | |
| if: github.ref == 'refs/heads/main' | |
| # NOTE: Azure Files does not support FIC or managed identity at this time | |
| with: | |
| inlineScript: | | |
| az storage file upload \ | |
| --account-key ${{ secrets.AZURE_FILES_SP }} \ | |
| --account-name ${{ vars.AZURE_FILES_USERNAME }} \ | |
| --source /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/site.zip \ | |
| -s oss-live | |
| az storage file upload \ | |
| --account-key ${{ secrets.AZURE_FILES_SP }} \ | |
| --account-name ${{ vars.AZURE_FILES_USERNAME }} \ | |
| --source /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/content.json \ | |
| -s oss-live | |
| - uses: azure/cli@v2 | |
| name: "Upload dev content (next branch)" | |
| if: github.ref == 'refs/heads/next' | |
| # NOTE: Azure Files does not support FIC or managed identity at this time | |
| with: | |
| inlineScript: | | |
| az storage file upload \ | |
| --account-key ${{ secrets.AZURE_FILES_SP }} \ | |
| --account-name ${{ vars.AZURE_FILES_USERNAME }} \ | |
| --source /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/site.zip \ | |
| -s oss-dev | |
| az storage file upload \ | |
| --account-key ${{ secrets.AZURE_FILES_SP }} \ | |
| --account-name ${{ vars.AZURE_FILES_USERNAME }} \ | |
| --source /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/content.json \ | |
| -s oss-dev |