A reusable GitHub Action that deploys SDK build artifacts to prod-cdn.ably.com (S3) with semantic versioning.
Given a tag like 1.2.3, each matched file is uploaded three times with version suffixes:
filename-1.js(major - consumers can pin to latest v1)filename-1.2.js(minor)filename-1.2.3.js(exact)
permissions:
id-token: write
contents: read
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::${{ secrets.ABLY_AWS_ACCOUNT_ID_SDK }}:role/prod-ably-sdk-cdn
role-session-name: ${{ github.run_id }}-${{ github.run_number }}
- uses: ably/cdn-deploy-action@v1
with:
source-dir: dist
file-regex: '^ably\.umd\.cjs$'
tag: ${{ github.ref_name }}| Input | Required | Default | Description |
|---|---|---|---|
source-dir |
Yes | - | Directory containing files to upload |
file-regex |
Yes | - | Regex to match files for upload |
tag |
Yes | - | Semver release tag (e.g. 1.2.3) |
bucket |
No | prod-cdn.ably.com |
S3 bucket name |
root |
No | lib |
Root folder inside the S3 bucket |
Note: The
taginput depends on how the workflow is triggered. Use${{ github.ref_name }}for workflows triggered by a release or tag push. Use${{ github.event.inputs.version }}for manually triggered (workflow_dispatch) workflows.
- uses: ably/cdn-deploy-action@v1
with:
source-dir: build
file-regex: '^(ably|push\.umd|liveobjects\.umd)?(\.min)?\.js$'
tag: ${{ github.event.inputs.version }}- uses: ably/cdn-deploy-action@v1
with:
source-dir: dist/core
file-regex: '^(ably-chat)?\.(umd\.c)?js$'
tag: ${{ github.ref_name }}- uses: ably/cdn-deploy-action@v1
with:
source-dir: dist
file-regex: '^ably-ai-transport\.umd\.cjs$'
tag: ${{ github.ref_name }}This action expects the calling workflow to configure AWS credentials before invoking it, using GitHub OIDC via aws-actions/configure-aws-credentials. The action picks up credentials from the environment automatically.
The workflow job needs these permissions for OIDC to work:
permissions:
id-token: write
contents: readThe IAM role used across Ably SDK repos for CDN deployment is prod-ably-sdk-cdn. If you are unsure whether the appropriate IAM role has been configured for your repository, please speak to the Ably SDK team.
npm ci
npm run lint
npm run typecheckThis action runs TypeScript source directly at runtime using tsx (via a composite action with actions/setup-node). There is no build or bundle step - edit src/, commit, done.
See CONTRIBUTING.md.