Skip to Content

CI/CD & Safe Deployments

Ship Odoo module changes from Git with one command: tested on a copy, backed up first, upgraded and checked automatically.

ONE COMMAND, EVERY TIME

From Git to production without surprises

Copying module files to the server by hand works until the day it breaks the live site. A pipeline does the same steps in the same order every time, and stops when something is wrong.

1Push to GitGitHub or GitLab
2Run testsOn a copy of your data
3Back upDatabase and files
4UpgradeOnly changed modules
5Restart and checkSite and logs
6NotifyResult on Telegram

Git repository

Your custom modules in one repository with a main branch for production, so every change has a history: what, who and when.

Staging copy

A copy of the live database with email, payments and scheduled jobs switched off. Changes are tried there first, with real data.

Deploy script

One command that updates the code, backs up, upgrades only the modules that changed and restarts Odoo.

HOW IT IS IMPLEMENTED

The parts of the pipeline

Based on the deploy script used on a live Odoo server.

  1. Put your modules in Git

    The server's addons folder becomes a checkout of your repository. The repository is the only source of truth: nothing is edited by hand on the server.

    Repository layout
    my-odoo-addons/
    β”œβ”€β”€ my_sales_extension/
    β”‚   β”œβ”€β”€ __manifest__.py      # 'version': '20.0.1.4.0'
    β”‚   β”œβ”€β”€ models/
    β”‚   β”œβ”€β”€ views/
    β”‚   └── tests/
    └── my_reports/
  2. Test on a staging copy

    A recent backup is restored as a staging database and made safe, then the changed module is upgraded with its tests.

    Staging test run
    odoo neutralize -d staging              # no emails, payments or scheduled jobs
    odoo -d staging -u my_sales_extension \
         --test-enable --test-tags /my_sales_extension
  3. Deploy with one command

    The deploy script compares each module's version with the database, so it upgrades exactly what changed. It backs up first and refuses to upgrade if the backup fails.

    /odoo/scripts/update-addons.sh (excerpt)
    git fetch --prune origin
    git reset -q --hard "origin/$BRANCH"          # the repository wins
    
    # modules whose files changed or whose version differs from the database
    changed=$(git diff --name-only "$before" "$after" | cut -d/ -f1 | sort -u)
    
    /odoo/scripts/backup.sh || { echo "backup failed; not upgrading" >&2; exit 1; }
    
    docker compose exec -T odoo odoo -d "$db" -u "$modules" --stop-after-init --no-http
    docker compose restart odoo
    What a deploy prints
    branch: main
    addons: 053de37 -> 8a41f02
    mydb: my_sales_extension 20.0.1.3.0 -> 20.0.1.4.0
    2026-11-21T02:31:07+06:00 backup ok: /odoo/backups/20261121-023044 (412M)
    upgrading in mydb: my_sales_extension
    upgrade ok in mydb
    Odoo restarted.
  4. Trigger it from GitHub (optional)

    A push to the main branch, or a button in GitHub, runs the same script on the server through a dedicated deploy key.

    .github/workflows/deploy.yml
    name: Deploy to production
    on:
      workflow_dispatch:
      push:
        branches: [main]
    jobs:
      deploy:
        runs-on: ubuntu-latest
        environment: production        # can require a manual approval
        steps:
          - name: Run the deploy script on the server
            env:
              SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
              HOST: ${{ secrets.DEPLOY_HOST }}
            run: |
              install -m 600 /dev/null key
              printf '%s\n' "$SSH_KEY" > key
              ssh -i key -o StrictHostKeyChecking=accept-new deploy@"$HOST" /odoo/scripts/update-addons.sh
  5. If an upgrade fails

    Odoo rolls the failed upgrade back and keeps running the old version. The script prints the error, the result goes to Telegram, and the backup from seconds earlier is there if data needs restoring.

A good fit if

You have custom Odoo modules Updates are copied to the server by hand An upgrade has broken the live site before Several developers work on the same code
HOW YOU BENEFIT

Changes without fear

πŸ§ͺTested before live

Problems show up on the staging copy, not in front of customers.

βͺAlways a way back

A backup from seconds before every change and the previous code in Git.

⏱️Minutes, not hours

A deploy is one command or one click, outside office hours if you like.

πŸ“œFull history

See exactly what changed in each release and who approved it.

🀝Any developer can work safely

Freelancers push to Git; only the pipeline touches production.

πŸ””Result on your phone

Success or failure arrives on Telegram the moment it finishes.

QUESTIONS

Common questions

Do I need GitHub Actions?

No. The deploy script runs from the server with one command; GitHub Actions only adds a button or an automatic trigger.

Does it work with modules from the Odoo Apps store?

Yes. Purchased modules are kept in the repository like your own and upgraded the same way.

What about Odoo.sh?

Odoo.sh has its own pipeline. This service is for Odoo on your own server.