Publish CDN assets in CI/CD pipelines
Build your app, publish assets to Smooth CDN from CI/CD, and keep release workflows repeatable across systems like GitHub Actions, Azure Pipelines, and Jenkins.
The problem
Teams often automate application deployments but still handle static assets as a separate, inconsistent step. That creates mismatches between builds, releases, and the files users actually load in production.
Without a CDN publish step inside CI/CD, asset delivery becomes part manual process, part custom scripting, and part tribal knowledge.
Manual uploads after deploy
Assets out of sync with builds
Different scripts in every project
No repeatable release step
Harder deployment discipline
CDN adoption handled separately
Solution
Smooth CDN turns asset publishing into a standard CI/CD step. Keep the same config in your repository, authenticate with a token, and define the publish flow directly inside your deployment config.
1
Authenticate the pipeline
CI/CD should use a non-interactive token instead of manual login. Smooth CDN CLI reads the SCDN_TOKEN environment variable, so the same workflow can run on every build.
export SCDN_TOKEN="your_api_token"2
Keep asset config in the repository
Store your Smooth CDN project config next to the app code so builds and releases always know what should be published. This keeps the asset publishing flow stored directly with the project.
{
"project": "My App Assets",
"projectSlug": "my-app-assets",
"sources": [
"./dist/**/*.{js,css}",
"./public/**/*.{png,jpg,svg,webp,json,mp4,mov,webm,pdf}"
],
"replacePath": {
"/dist/": "/",
"/public/": "/"
},
"excludes": [
"./dist/tmp/*"
]
}3
Set up deployment config
The publish step can be expressed in the native config of whichever CI/CD system your team already uses. Below are examples for three common options, each including build and publish commands in the same deployment flow.
name: Publish assets to Smooth CDN
on:
push:
branches: [main]
jobs:
publish-assets:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build assets
run: npm run build
- name: Install Smooth CDN CLI
run: npm install -g @smoothcdn/cli
- name: Publish assets
env:
SCDN_TOKEN: ${{ secrets.SCDN_TOKEN }}
run: |
scdn pushtrigger:
branches:
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
- script: npm ci
displayName: Install dependencies
- script: npm run build
displayName: Build assets
- script: npm install -g @smoothcdn/cli
displayName: Install Smooth CDN CLI
- script: |
scdn push
displayName: Publish assets to Smooth CDN
env:
SCDN_TOKEN: $(SCDN_TOKEN)pipeline {
agent any
environment {
SCDN_TOKEN = credentials('scdn-token')
}
stages {
stage('Install') {
steps {
sh 'npm ci'
sh 'npm install -g @smoothcdn/cli'
}
}
stage('Build') {
steps {
sh 'npm run build'
}
}
stage('Publish assets') {
steps {
sh '''
scdn push
'''
}
}
}
}What You get
A repeatable asset publishing step that fits naturally into release pipelines instead of sitting next to them as a manual extra task.
Same asset flow on every release
No manual uploads after deploy
Better separation between app deploy and asset delivery
Cleaner publishing workflow
Cleaner deployment and release discipline
Easy CI/CD adoption with one CLI
Make asset publishing part of every deployment
Add a simple CDN publish step to your CI/CD workflow and keep asset releases consistent.