Skip to content

Commit 647f8bf

Browse files
committed
project: add CDN deployment workflow
Deploy core ESM and UMD bundles to prod-cdn.ably.com on every GitHub release. Uses AWS OIDC federation for authentication. Versioned copies are uploaded (e.g. 0.0.2 -> 0, 0.0, 0.0.2) so consumers can pin to major/minor/patch.
1 parent 5b4e7f5 commit 647f8bf

4 files changed

Lines changed: 344 additions & 1 deletion

File tree

.github/workflows/publish.cdn.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish to CDN
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
# These permissions are necessary to run the configure-aws-credentials action
11+
permissions:
12+
id-token: write
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.ref }}
18+
- name: Configure AWS Credentials
19+
uses: aws-actions/configure-aws-credentials@v4
20+
with:
21+
aws-region: us-east-1
22+
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/prod-ably-sdk-cdn
23+
role-session-name: ${{ github.run_id }}-${{ github.run_number }}
24+
- uses: actions/setup-node@v6
25+
with:
26+
node-version: 24
27+
cache: npm
28+
- run: npm ci
29+
- run: node scripts/cdn_deploy.js --skipCheckout --tag=${{ github.ref_name }}

package-lock.json

Lines changed: 179 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"@typescript-eslint/eslint-plugin": "^8.26.1",
103103
"@typescript-eslint/parser": "^8.26.1",
104104
"ai": "^6.0.137",
105+
"aws-sdk": "^2.1692.0",
105106
"eslint": "^9.31.0",
106107
"eslint-plugin-import": "^2.31.0",
107108
"eslint-plugin-jsdoc": "^60.7.0",
@@ -112,6 +113,7 @@
112113
"globals": "^16.0.0",
113114
"jiti": "^2.6.1",
114115
"jsdom": "^29.0.1",
116+
"minimist": "^1.2.8",
115117
"prettier": "^3.5.3",
116118
"tsx": "^4.21.0",
117119
"typescript": "^5.8.2",

0 commit comments

Comments
 (0)