-
Notifications
You must be signed in to change notification settings - Fork 10
75 lines (68 loc) · 2.02 KB
/
nightly.yml
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
name: Nightly build
on:
schedule:
- cron: "0 3 * * *"
push:
branches:
- master
- main
jobs:
build:
name: Build integration for
runs-on: ubuntu-latest
strategy:
matrix:
goos: [ linux ]
goarch: [ amd64, arm64, arm ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build integration
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
make compile
- name: Upload artifact for docker build step
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: nri-kube-events-${{ matrix.goos }}-${{ matrix.goarch }}
path: bin/nri-kube-events-${{ matrix.goos }}-${{ matrix.goarch }}
release:
name: Build and push docker images
needs: [ build ]
runs-on: ubuntu-latest
env:
DOCKER_IMAGE_NAME: newrelic/nri-kube-events
DOCKER_IMAGE_TAG: nightly
DOCKER_PLATFORMS: "linux/amd64,linux/arm64,linux/arm" # Must be consistent with the matrix from the job above
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Download all artifacts from build job
uses: actions/download-artifact@v2
with:
path: bin
- uses: docker/login-action@v1
with:
username: ${{ secrets.FSI_DOCKERHUB_USERNAME }}
password: ${{ secrets.FSI_DOCKERHUB_TOKEN }}
- name: Build and push docker image
run: |
docker buildx build --push --platform=$DOCKER_PLATFORMS \
-t $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG \
.