forked from kubernetes/node-problem-detector
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.38 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
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v3
with:
go-version: "1.21"
- uses: golangci/golangci-lint-action@v6
with:
version: v1.58
- run: |
apt-get -y install libsystemd-dev
make test
node-problem-detector:
name: "Publish node-problem-detector image on dockerhub"
needs:
- test
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: Surgo/docker-smart-tag-action@v1
id: smarttag
with:
docker_image: tsuru/node-problem-detector
default_branch: master
tag_with_sha: "true"
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: docker/build-push-action@v5
with:
file: ./Dockerfile
push: true
tags: ${{ steps.smarttag.outputs.tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64