-
Notifications
You must be signed in to change notification settings - Fork 549
71 lines (70 loc) · 2.61 KB
/
build.yml
File metadata and controls
71 lines (70 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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