Advertisement Space - Google AdSense
Key Features
⚡ Vue 3 Composition API with <script setup>
🌍 Global CDN with 300+ edge locations
🔒 Automatic HTTPS with SSL certificates
🔄 Preview deployments for pull requests
💰 Free tier: 500 builds/month, unlimited bandwidth
📦 Optimized builds with code splitting
📋 Configuration Files
Copy these files into your project:
.github/workflows/deploy.yml
# .github/workflows/deploy.yml
name: Deploy Vue to Cloudflare Pages
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
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 Vue app
run: npm run build
env:
NODE_ENV: production
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: my-vue-app
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
outDir: 'dist',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
vendor: ['vue', 'vue-router'],
},
},
},
},
})
# package.json
{
"name": "my-vue-app",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit"
},
"dependencies": {
"vue": "^3.3.11",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.0",
"@vue/tsconfig": "^0.5.0",
"npm-run-all2": "^6.1.1",
"typescript": "~5.3.0",
"vite": "^5.0.10",
"vue-tsc": "^1.8.27"
}
}
# tsconfig.json
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
# env.d.ts
/// <reference types="vite/client" /> 📦 Need all the files?
Download the complete blueprint with README, package.json, and all configuration files.
📥 Browse All FilesConfiguration Summary
🚀
Framework
Vue
☁️
Cloud Provider
Cloudflare Pages & Workers
⚙️
Deployment Tool
GitHub Actions
💰
Pricing
Free tier generous, zero egress fees, flat-rate pricing
☁️ About Cloudflare Pages & Workers
Edge-first platform with zero egress fees
✓ Best For
Static sites, edge computing, cost-effective CDN, global performance
💰 Pricing
Free tier generous, zero egress fees, flat-rate pricing
Available Services:
✓ Pages - Static Site Hosting
✓ Workers - Edge Computing
✓ R2 - Object Storage (S3-compatible)
✓ D1 - SQLite Database
✓ KV - Key-Value Storage
✓ Durable Objects - Stateful Edge
✓ Stream - Video Streaming
✓ Images - Image Optimization
✓ CDN - Global Network
✓ DNS - Managed DNS
✅ Prerequisites
Make sure you have these ready before starting:
✓ Node.js 18+ installed
✓ GitHub account with repository admin access
✓ Cloudflare account (free tier works)
✓ Git installed locally
✓ Basic knowledge of Vue 3 and TypeScript
🚀 Step-by-Step Implementation
Follow these steps to deploy your Vue application:
- 1Create Vue app: npm create vue@latest my-vue-app
- 2Select TypeScript, Vue Router (optional), and other features
- 3Navigate to project: cd my-vue-app
- 4Install dependencies: npm install
- 5Test locally: npm run dev
- 6Create GitHub repository and push code
- 7In Cloudflare Dashboard → Pages → Create project
- 8Get Account ID from Pages dashboard
- 9Create API Token with Cloudflare Pages Edit permissions
- 10Add CLOUDFLARE_API_TOKEN to GitHub Secrets
- 11Add CLOUDFLARE_ACCOUNT_ID to GitHub Secrets
- 12Create .github/workflows/deploy.yml
- 13Update projectName in workflow
- 14Commit and push to main branch
- 15Monitor deployment in GitHub Actions
- 16Access site at https://my-vue-app.pages.dev
💡 Additional Notes & Tips
- 🎯 Full TypeScript support
- 🛣️ Vue Router for SPA navigation
- ⚠️ For SSR, consider using Nuxt.js instead
📚 About This Stack
💚 Vue
Progressive JavaScript framework for building UIs
🟠 Cloudflare
Edge-first platform with zero egress fees
⚙️ GitHub Actions
CI/CD automation directly in GitHub
🏷️ Tags & Keywords
Vue Cloudflare Cloudflare Pages & Workers GitHub Actions CI/CD DevOps Infrastructure as Code Vue Deployment Cloudflare Hosting Production Ready 2026Advertisement Space - Google AdSense