Skip to content

Commit fe5a24a

Browse files
author
opentofu[bot]
committed
chore(CI): add github workflow
1 parent b6a3fb8 commit fe5a24a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
build-edge:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Setup bun
19+
uses: oven-sh/setup-bun@v2
20+
with:
21+
bun-version: latest
22+
- name: Install bun deps
23+
run: bun install
24+
- name: Cache node_modules
25+
uses: actions/cache@v4
26+
with:
27+
path: node_modules
28+
key: node-${{ runner.os }}-${{ hashFiles('**/bun.lock') }}
29+
restore-keys: |
30+
node-${{ runner.os }}-
31+
node-
32+
- name: Bun build
33+
run: bun run build
34+
- name: Upload artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: dist-${{ github.run_number }}
38+
path: dist
39+
- name: Azure CLI Login
40+
uses: azure/login@v2
41+
with:
42+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
43+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
44+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
45+
- name: Upload to blob storage
46+
uses: azure/CLI@v1
47+
with:
48+
inlineScript: |
49+
az storage blob upload-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --auth-mode key -d '$web' -s .
50+
az cdn endpoint purge --content-paths "/*" --profile-name ${{ secrets.CDN_PROFILE_NAME }} --name ${{ secrets.CDN_ENDPOINT }} --resource-group ${{ secrets.CDN_RESOURCE_GROUP }}

0 commit comments

Comments
 (0)