-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (69 loc) · 2.21 KB
/
build-and-push.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
name: Build & Push
on:
workflow_call:
defaults:
run:
working-directory: go/src/github.com/stackrox/infra
jobs:
build-and-push-server:
runs-on: ubuntu-latest
container:
image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.4.4
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/stackrox/infra
- name: Get NPM package access
env:
GITHUB_TOKEN: ${{ secrets.RHACS_BOT_GITHUB_TOKEN }}
run: echo "//npm.pkg.github.com/:_authToken=\"$GITHUB_TOKEN\"" > ~/.npmrc
- name: Setup env
run: |
GOPATH="$GITHUB_WORKSPACE/go"
echo GOPATH="${GOPATH}" >> "$GITHUB_ENV"
PATH="${PATH}:${GOPATH}/bin"
echo PATH="${PATH}" >> "$GITHUB_ENV"
- name: Generate src
# This is committed at generated/ but building here ensure the make
# targets do not go stale and that any updates are committed.
run: |
make proto-generated-srcs
git diff --exit-code HEAD
- name: Build Infra Server
run: |
make image
- name: Login for image push
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_RHACS_ENG_INFRA_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_INFRA_RW_PASSWORD }}
- name: Push
run: |
make push
build-and-push-certifier:
runs-on: ubuntu-latest
container:
image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.4.4
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/stackrox/infra
- name: Build Certifier
run: |
cd certifier && make image
- name: Login for image push
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_RHACS_ENG_INFRA_RW_USERNAME }}
password: ${{ secrets.QUAY_RHACS_ENG_INFRA_RW_PASSWORD }}
- name: Push
run: |
cd certifier && make push