Merge pull request #475 from microsoft/dependabot/npm_and_yarn/primer… #328
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 | |
| 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 | |
| NEXT_ENV_DESCRIPTOR=production NEXT_ONE_DS_INSTRUMENTATION_KEY=b341ec446e65436485df678003ce82f7 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 |