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.
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.
The parts of the pipeline
Based on the deploy script used on a live Odoo server.
-
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 layoutmy-odoo-addons/ βββ my_sales_extension/ β βββ __manifest__.py # 'version': '20.0.1.4.0' β βββ models/ β βββ views/ β βββ tests/ βββ my_reports/ -
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 runodoo neutralize -d staging # no emails, payments or scheduled jobs odoo -d staging -u my_sales_extension \ --test-enable --test-tags /my_sales_extension -
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 odooWhat a deploy printsbranch: 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. -
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.ymlname: 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 -
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
Changes without fear
Problems show up on the staging copy, not in front of customers.
A backup from seconds before every change and the previous code in Git.
A deploy is one command or one click, outside office hours if you like.
See exactly what changed in each release and who approved it.
Freelancers push to Git; only the pipeline touches production.
Success or failure arrives on Telegram the moment it finishes.
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.
