-
Notifications
You must be signed in to change notification settings - Fork 148
99 lines (81 loc) · 2.48 KB
/
build.yaml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: build
on:
push:
branches:
- "release-4.5.X"
- "dev-4.5.X"
tags:
- "4.*.*.*.*"
pull_request:
branches:
- "release-4.5.X"
env:
TARGET: GHCR
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
odoo_serie: ["11.0","12.0", "13.0", "14.0", "15.0", "16.0", "17.0"]
steps:
- uses: actions/checkout@v4
with:
ref: dev-4.5.X
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/camptocamp/docker-odoo-project
flavor: |
prefix=${{ matrix.odoo_serie }}-4.x,onlatest=true
tags: |
type=raw,value={{branch}}-latest
type=raw,value={{branch}}-{{date 'YYYYMMDD'}}
type=ref,event=tag
type=ref,event=pr
type=schedule,pattern=nightly
type=raw,value={{branch}}-4.x
- name: Setup build dir
run: |
VERSION=${{ matrix.odoo_serie }} SRC=build make setup
- name: Build
uses: docker/build-push-action@v3
with:
context: ./build
push: false
load: true
tags: ci-latest:0.1
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Test
run: make VERSION=${{ matrix.odoo_serie }} test
- name: Scan image
id: scan
uses: sysdiglabs/scan-action@v5
with:
image-tag: sysdiglabs/dummy-vuln-app:latest
sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name == 'push' || github.event_name == 'schedule'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Tag & Push
if: github.event_name == 'push' || github.event_name == 'schedule'
id: docker_push
uses: docker/build-push-action@v3
with:
context: ./build
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_push.outputs.digest }}