Automating Odoo Deployments with GitHub Actions
Continuous deployment can significantly improve your Odoo development workflow. This guide shows you how to automate deployments using GitHub Actions and Nurosentrix webhooks.
Overview
With CI/CD, you can:
Prerequisites
Setting Up the Webhook
First, configure the webhook in Nurosentrix:
1. Go to Instance → CI/CD
2. Click "Add Webhook"
3. Copy the webhook URL and secret
GitHub Actions Workflow
Create `.github/workflows/deploy.yml`:
name: Deploy to Nurosentrix
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trigger Deployment
run: |
curl -X POST ${{ secrets.NUROSENTRIX_WEBHOOK }} \
-H "X-Webhook-Secret: ${{ secrets.WEBHOOK_SECRET }}" \
-H "Content-Type: application/json" \
-d '{"ref": "${{ github.ref }}", "commit": "${{ github.sha }}"}'
Adding Tests
Run Odoo tests before deployment:
run: |
docker run --rm \
-v $PWD:/mnt/extra-addons \
odoo:17.0 \
odoo --test-enable -d test_db --stop-after-init
Deployment Strategies
Rolling Deployment
Updates instances one at a time to maintain availability.
Blue-Green Deployment
Deploys to a staging environment first, then switches traffic.
Conclusion
CI/CD automation reduces deployment errors and speeds up your development cycle. Start with simple workflows and expand as needed.