Docker image #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker image for 15.0 | |
on: | |
workflow_dispatch: | |
permissions: | |
packages: write | |
env: | |
IMAGE_NAME: doodba | |
IMAGE_REGISTRY: ghcr.io/cmwedding-it | |
REGISTRY_USER: oskardotglobal | |
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
base: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Check out to doodba source | |
uses: actions/checkout@v2 | |
with: | |
repository: Tecnativa/doodba | |
path: src | |
- name: Replace dockerfile with patched one | |
run: rm src/15.0.Dockerfile && mv Dockerfile src/15.0.Dockerfile | |
- name: Get date & commit sha | |
run: | | |
echo "BUILD_DATE=$(date --rfc-3339 ns)" >> $GITHUB_OUTPUT && \ | |
echo "VCS_REF=$(git -C src rev-parse HEAD)" >> $GITHUB_OUTPUT | |
id: build_args | |
- name: Build onbuild | |
id: build_image_onbuild | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.IMAGE_NAME }} | |
tags: 15.0-bookworm-onbuild | |
build-args: | | |
ODOO_VERSION=15.0 | |
VCS_REF=${{ steps.build_args.outputs.VCS_REF }} | |
BUILD_DATE=${{ steps.build_args.outputs.BUILD_DATE }} | |
containerfiles: | | |
src/15.0.Dockerfile | |
extra-args: | | |
--target onbuild | |
context: ./src | |
- name: Push onbuild to GHCR | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_image_onbuild.outputs.image }} | |
tags: ${{ steps.build_image_onbuild.outputs.tags }} | |
registry: ${{ env.IMAGE_REGISTRY }} | |
username: ${{ env.REGISTRY_USER }} | |
password: ${{ env.REGISTRY_PASSWORD }} | |