next #311
This file contains 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 | |
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 |