Deploy from GitHub
Set up automatic deployments from GitHub so your site updates every time you push code. This guide uses GitHub Actions with the official Quant deploy action.
Prerequisites
Section titled “Prerequisites”- A GitHub account
- A repository with your static site
- A Quant project already created
Step 1: Get your credentials
Section titled “Step 1: Get your credentials”From the Quant Dashboard:
- Note your Organisation ID (shown in the dashboard URL after
/org/) - Select your project and go to Integrations
- Copy your Project Token
You’ll need:
QUANT_CUSTOMER— Your organisation IDQUANT_PROJECT— Your project machine nameQUANT_TOKEN— Your project token
Step 2: Add secrets to GitHub
Section titled “Step 2: Add secrets to GitHub”- Go to your GitHub repository
- Click Settings → Secrets and variables → Actions
- Click New repository secret and add each:
| Name | Value |
|---|---|
QUANT_CUSTOMER | Your organisation ID |
QUANT_PROJECT | Your project name |
QUANT_TOKEN | Your project token |
Step 3: Create the workflow file
Section titled “Step 3: Create the workflow file”Create .github/workflows/deploy.yml in your repository:
name: Deploy to Quant
on: push: branches: - main # or master, depending on your default branch
jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4
- name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'npm'
- name: Install dependencies run: npm ci
- name: Build site run: npm run build
- name: Deploy to Quant uses: quantcdn/deploy-action@v6 with: customer: ${{ secrets.QUANT_CUSTOMER }} project: ${{ secrets.QUANT_PROJECT }} token: ${{ secrets.QUANT_TOKEN }} dir: dist # Change to your build output directory skip-purge: true
- name: Purge CDN cache uses: quantcdn/purge-action@v6 with: customer: ${{ secrets.QUANT_CUSTOMER }} project: ${{ secrets.QUANT_PROJECT }} token: ${{ secrets.QUANT_TOKEN }} url_pattern: "/*"Step 4: Push and deploy
Section titled “Step 4: Push and deploy”Commit and push the workflow file:
git add .github/workflows/deploy.ymlgit commit -m "Add Quant deployment workflow"git pushGo to Actions in your GitHub repository to watch the deployment run.
Faster deployments with revision tracking
Section titled “Faster deployments with revision tracking”Add caching to skip unchanged files. The revision log stores md5 hashes of deployed assets, so subsequent deploys only upload what changed.
name: Deploy to Quant
on: push: branches: - main
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: '22' cache: 'npm'
- name: Install dependencies run: npm ci
- name: Restore revision log uses: actions/cache@v5 with: path: .quant-revision key: quant-revision-${{ github.ref }}-${{ github.run_id }} restore-keys: | quant-revision-${{ github.ref }}-
- name: Build site run: npm run build
- name: Deploy to Quant uses: quantcdn/deploy-action@v6 with: customer: ${{ secrets.QUANT_CUSTOMER }} project: ${{ secrets.QUANT_PROJECT }} token: ${{ secrets.QUANT_TOKEN }} dir: dist revision-log: .quant-revision skip-purge: true
- name: Purge CDN cache uses: quantcdn/purge-action@v6 with: customer: ${{ secrets.QUANT_CUSTOMER }} project: ${{ secrets.QUANT_PROJECT }} token: ${{ secrets.QUANT_TOKEN }} url_pattern: "/*"Deploy multiple branches
Section titled “Deploy multiple branches”Deploy main to production and develop to staging:
name: Deploy to Quant
on: push: branches: - main - develop
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: '20'
- name: Set environment run: | if [[ $GITHUB_REF == 'refs/heads/main' ]]; then echo "QUANT_PROJECT=${{ secrets.QUANT_PROJECT_PROD }}" >> $GITHUB_ENV echo "QUANT_TOKEN=${{ secrets.QUANT_TOKEN_PROD }}" >> $GITHUB_ENV else echo "QUANT_PROJECT=${{ secrets.QUANT_PROJECT_STAGING }}" >> $GITHUB_ENV echo "QUANT_TOKEN=${{ secrets.QUANT_TOKEN_STAGING }}" >> $GITHUB_ENV fi
- name: Install and build run: | npm ci npm run build
- name: Deploy to Quant uses: quantcdn/deploy-action@v6 with: customer: ${{ secrets.QUANT_CUSTOMER }} project: ${{ env.QUANT_PROJECT }} token: ${{ env.QUANT_TOKEN }} dir: dist skip-purge: true
- name: Purge CDN cache uses: quantcdn/purge-action@v6 with: customer: ${{ secrets.QUANT_CUSTOMER }} project: ${{ env.QUANT_PROJECT }} token: ${{ env.QUANT_TOKEN }} url_pattern: "/*"Add additional secrets for each environment:
QUANT_PROJECT_PROD/QUANT_TOKEN_PRODQUANT_PROJECT_STAGING/QUANT_TOKEN_STAGING
Deploy action options
Section titled “Deploy action options”| Option | Description |
|---|---|
customer | Organisation ID (required) |
project | Project name (required) |
token | Project token (required) |
dir | Build output directory (required) |
revision-log | Path for revision tracking file |
skip-purge | Skip automatic cache purge (recommended) |
chunk-size | Concurrent uploads (default: 10, max: 20) |
Troubleshooting
Section titled “Troubleshooting”Deployment succeeds but site doesn’t update
Section titled “Deployment succeeds but site doesn’t update”Check that the cache was purged. If using skip-purge: true, ensure the purge action runs after deploy.
”Invalid credentials” error
Section titled “”Invalid credentials” error”Verify your secrets are correct:
- Check for extra whitespace when copying tokens
- Ensure the token has deploy permissions for the project
- Confirm the organisation ID and project name match
Build fails
Section titled “Build fails”The build step is separate from Quant deployment. Check:
- Node.js version matches your local environment
- All dependencies are in
package.json - Build command is correct for your framework
Next steps
Section titled “Next steps”- Add a custom domain — Point your domain to Quant
- Configure WAF — Protect your site
- Framework-specific guides — Optimised workflows for Astro, Next.js, etc.