forked from draios/sysdig
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.94 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
67
68
name: CI Build
on:
pull_request:
branches: [dev]
jobs:
builder:
env:
REGISTRY: ghcr.io
BUILDER_IMAGE_BASE: ghcr.io/draios/sysdig-builder-pr
BUILDER_DEV: ghcr.io/draios/sysdig-builder:dev
runs-on: ubuntu-latest
steps:
- name: Checkout Sysdig
uses: actions/checkout@v2
- name: Check if builder is modified
id: builder-files
uses: tj-actions/[email protected]
with:
files: |
^docker/builder
- name: Login to Github Packages
if: steps.builder-files.outputs.any_changed == 'true'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get new builder image tag
id: get-new-builder
if: steps.builder-files.outputs.any_changed == 'true'
run: |
echo "::set-output name=builder_image::${{ env.BUILDER_IMAGE_BASE }}:${{ github.event.pull_request.number }}"
- name: Build new builder
id: build-builder
if: steps.builder-files.outputs.any_changed == 'true'
uses: docker/build-push-action@v2
with:
context: docker/builder
tags: ${{ steps.get-new-builder.outputs.builder_image }}
push: true
outputs:
builder_image: ${{ (steps.builder-files.outputs.any_changed == 'true') && steps.get-new-builder.outputs.builder_image || env.BUILDER_DEV }}
build-sysdig-linux:
needs: builder
runs-on: ubuntu-latest
container:
image: ${{ needs.builder.outputs.builder_image }}
steps:
- name: Checkout Sysdig
uses: actions/checkout@v2
with:
path: sysdig
- name: Link paths
run: |
mkdir -p /source
ln -s "$GITHUB_WORKSPACE/sysdig" /source/sysdig
- name: Build
run: build cmake
- name: Build packages
run: build package