-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (68 loc) · 2.11 KB
/
build-fork.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
name: Build
concurrency:
group: "${{ github.repository }}${{ github.ref }}buildfork"
cancel-in-progress: true
on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
permissions:
contents: read
packages: write
env:
REGISTRY: "dummy"
jobs:
build:
name: Build
if: github.repository != 'otterize/intents-operator' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'otterize/intents-operator')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
registry: ${{ steps.registry.outputs.registry }} # workaround since env is not available outside of steps, i.e. in calling external workflows like we later do in e2e-test
strategy:
matrix:
service:
- intents-operator
steps:
- id: registry
run: echo "registry=${{ env.REGISTRY }}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
driver-opts: network=host
- name: Build & Test
uses: docker/build-push-action@v2
with:
context: src/
file: src/${{ matrix.service }}.Dockerfile
tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ matrix.service }}:${{ github.sha }}
network: host
outputs: type=docker,dest=${{ matrix.service }}.tar
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
"VERSION=${{ github.run_id }}"
- uses: actions/upload-artifact@v3
with:
path: ${{ matrix.service }}.tar
name: ${{ env.REGISTRY }}_${{ github.actor }}_${{ matrix.service }}_${{ github.sha }}.tar
netpol-e2e-test:
uses: ./.github/workflows/netpol-e2e-test.yaml
name: Trigger e2e tests
with:
registry: ${{ needs.build.outputs.registry }}
operator-tag: ${{ github.sha }}
operator-image: ${{ github.actor }}/intents-operator
needs:
- build