feat: adding github action to push image into registry

pull/550/head
Avei20 2025-05-07 01:28:37 +07:00
parent fc5e9e6c2d
commit af8544f88f
3 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,38 @@
name: Build and Push Docker Images
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image for 17.0
uses: docker/build-push-action@v4
with:
context: ./17.0
file: ./17.0/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/17.0:latest
- name: Build and push Docker image for 18.0
uses: docker/build-push-action@v4
with:
context: ./18.0
file: ./18.0/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/18.0:latest

View File

@ -89,7 +89,9 @@ RUN chown odoo /etc/odoo/odoo.conf \
&& mkdir -p /mnt/extra-addons \
&& chown -R odoo /mnt/extra-addons \
&& chmod +x /init-odoo.sh \
&& chown -R odoo /init-odoo.sh
&& chown -R odoo /init-odoo.sh \
&& chmod +x /entrypoint.sh \
&& chown -R odoo /entrypoint.sh
VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]

View File

@ -9,7 +9,7 @@ services:
- 1234:5432
odoo:
build:
context: ./17.0
context: ./18.0
dockerfile: Dockerfile.custom
environment:
DB_NAME: odoo