-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.94 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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: Patch pip installer to allow caching
run: |
sed -i -E 's/^ _install_command = \["pip", "install", "--no-cache-dir", "-r"\]$/ _install_command = \["pip", "install", "-r"\]/' lib/doodbalib/installer.py
- 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 }}