-
Notifications
You must be signed in to change notification settings - Fork 17
66 lines (58 loc) · 1.54 KB
/
ci.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
name: CI Pipeline
on:
# Run on main and release branches
push:
branches:
- main
- v*.*
paths-ignore:
- 'docs/**'
- '**/*.md'
- '**/*.adoc'
pull_request:
branches:
- main
- v*.*
paths-ignore:
- 'docs/**'
- '**/*.md'
- '**/*.adoc'
jobs:
initialize:
name: Initialize
runs-on: ubuntu-20.04
outputs:
target_branch: ${{ env.target_branch }}
build_branch: ${{ env.build_branch }}
steps:
- name: Determine target branch
id: target_branch
run: |
echo "target_branch=${{ github.base_ref || github.ref_name }}" >> $GITHUB_ENV
# For the building branch, if we are running agains a PR, we need to indicate in the branch that is coming from a PR
- name: Determine build branch
id: build_branch
run: |
if [ -z "${{ github.base_ref }}" ];
then
BUILD_BRANCH="${{ github.ref_name }}"
else
BUILD_BRANCH="${{ github.base_ref }}"
fi
echo "build_branch=$BUILD_BRANCH" >> $GITHUB_ENV
- name: Log information
run: |
echo "Target branch: ${{ env.target_branch }}"
echo "Build branch: ${{ env.build_branch }}"
build_plugin:
name: Build plugin
runs-on: ubuntu-20.04
needs: [initialize]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.build_branch }}
- name: Build image
run: |
make -e CONTAINER_VERSION=$(sed -rn 's/^VERSION \?= (.*)/\1/p' Makefile) build-plugin-image