Deploy your Odoo PWA to GitHub Pages with GitHub Actions for continuous deployment.
Deploys Odoo PWA to GitHub Pages with automated GitHub Actions workflow for continuous deployment.
/plugin marketplace add jamshu/jamshi-marketplace/plugin install odoo-pwa-generator@jamshi-marketplaceDeploy your Odoo PWA to GitHub Pages with GitHub Actions for continuous deployment.
Before deploying, verify:
npm run build)⚠️ Note: GitHub Pages is static hosting only. Server-side API routes won't work.
Recommendation: For full Odoo PWA functionality with server-side API proxy:
You'll need to modify the Odoo client to use CORS-enabled direct Odoo API calls or deploy API routes separately.
# Ensure you're on main branch
git checkout main
git pull origin main
Check if .github/workflows/deploy.yml exists:
Go to: Repository → Settings → Secrets and variables → Actions
Add these secrets:
ODOO_API_KEY=your_production_api_key
ODOO_USERNAME=your.email@company.com
VITE_ODOO_URL=https://yourcompany.odoo.com
VITE_ODOO_DB=yourcompany-main
VITE_MODEL_NAME=x_expense
VITE_MODEL_DISPLAY_NAME=Expense
Repository → Settings → Pages:
gh-pages (will be created by Actions)/ (root)For framework-specific configuration:
SvelteKit (svelte.config.js):
paths: {
base: process.env.NODE_ENV === 'production' ? '/your-repo-name' : ''
}
React/Vue (vite.config.js):
base: process.env.NODE_ENV === 'production' ? '/your-repo-name/' : '/'
git add .
git commit -m "Configure GitHub Pages deployment"
git push origin main
The workflow should:
main branchgh-pages branchgh-pagesname: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm install
- run: npm run build
env:
VITE_ODOO_URL: ${{ secrets.VITE_ODOO_URL }}
VITE_ODOO_DB: ${{ secrets.VITE_ODOO_DB }}
VITE_MODEL_NAME: ${{ secrets.VITE_MODEL_NAME }}
VITE_MODEL_DISPLAY_NAME: ${{ secrets.VITE_MODEL_DISPLAY_NAME }}
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
CNAME file to static folder with your domainusername.github.ioAfter deployment, verify:
https://username.github.io/repo-name/deploy-github - Interactive GitHub Pages deploymentgh-pages branch existsProvide the user with: