-
Notifications
You must be signed in to change notification settings - Fork 18
40 lines (38 loc) · 1.32 KB
/
build_image_pr.yml
File metadata and controls
40 lines (38 loc) · 1.32 KB
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
name: Build PR image and upload artifact
on:
pull_request:
types: [labeled]
env:
WF_REGISTRY: quay.io/netobserv
WF_IMAGE: network-observability-cli
jobs:
build-pr-image:
if: ${{ github.event.label.name == 'ok-to-test' }}
name: Build PR image and upload artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install make
run: sudo apt -y install make
- name: get short sha
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: build and save image
run: OCI_BUILD_OPTS="--label quay.expires-after=2w" IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} CLEAN_BUILD=1 make tar-image
- name: make commands
run: USER=netobserv VERSION=${{ env.short_sha }} make commands
- name: upload commands
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: commands
path: build/
- name: save PR number
run: |
echo ${{ github.event.number }} > ./out/pr-id
echo ${{ env.short_sha }} > ./out/short-sha
echo ${{ steps.artifact-upload-step.outputs.artifact-url }} > ./out/commands-url
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: pr
path: out/