Skip to content

Commit a89ff15

Browse files
authored
Snap to blob storage as well
Also storing static files in blob.
1 parent 0304b14 commit a89ff15

1 file changed

Lines changed: 48 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ on:
88

99
permissions:
1010
contents: read
11+
id-token: write
1112

1213
jobs:
1314
build:
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v5
1718
name: "Check it out"
18-
- name: "Startup"
19-
run: pwd
19+
20+
- name: Login for OIDC blob upload ☁️
21+
uses: azure/login@v2.3.0
22+
with:
23+
client-id: ${{ secrets.BLOB_CLIENT_ID }}
24+
tenant-id: ${{ secrets.BLOB_TENANT_ID }}
25+
subscription-id: ${{ secrets.BLOB_SUBSCRIPTION_ID }}
26+
2027
- name: "Build the site"
2128
run: |
2229
npm install
@@ -39,10 +46,6 @@ jobs:
3946
with:
4047
name: website
4148
path: /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/site.zip
42-
- name: "List site files"
43-
working-directory: /home/runner/work/opensource.microsoft.com/opensource.microsoft.com
44-
run: |
45-
ls -la site.zip content.json
4649
- uses: azure/cli@v2
4750
name: "Upload to share via CLI (main)"
4851
if: github.ref == 'refs/heads/main'
@@ -75,3 +78,42 @@ jobs:
7578
--account-name ${{ vars.AZURE_FILES_USERNAME }} \
7679
--source /home/runner/work/opensource.microsoft.com/opensource.microsoft.com/content.json \
7780
-s oss-dev
81+
- uses: azure/cli@v2
82+
name: "Upload to blob via CLI (main)"
83+
if: github.ref == 'refs/heads/main'
84+
with:
85+
inlineScript: |
86+
az storage blob upload \
87+
--auth-mode login \
88+
--account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} \
89+
--container-name oss-live \
90+
--name site.zip \
91+
--file site.zip \
92+
--overwrite true
93+
az storage blob upload \
94+
--auth-mode login \
95+
--account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} \
96+
--container-name oss-live \
97+
--name content.json \
98+
--file content.json \
99+
--overwrite true
100+
101+
- uses: azure/cli@v2
102+
name: "Upload dev content as blob (next branch)"
103+
if: github.ref == 'refs/heads/next'
104+
with:
105+
inlineScript: |
106+
az storage blob upload \
107+
--auth-mode login \
108+
--account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} \
109+
--container-name oss-dev \
110+
--name site.zip \
111+
--file site.zip \
112+
--overwrite true
113+
az storage blob upload \
114+
--auth-mode login \
115+
--account-name ${{ secrets.AZURE_STORAGE_ACCOUNT_NAME }} \
116+
--container-name oss-dev \
117+
--name content.json \
118+
--file content.json \
119+
--overwrite true

0 commit comments

Comments
 (0)