Commit dada614 1 parent 3ef90ff commit dada614 Copy full SHA for dada614
File tree 2 files changed +44
-4
lines changed
2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 1
1
name : Build and Release
2
+
2
3
on :
3
4
release :
4
5
types : [published]
6
+
5
7
permissions :
6
8
contents : write
9
+
7
10
jobs :
8
11
build :
9
12
runs-on : ubuntu-latest
@@ -14,11 +17,11 @@ jobs:
14
17
uses : actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # ratchet:actions/setup-go@v5
15
18
with :
16
19
go-version : ' 1.21.7'
17
- - name : Install BCC Dependencies
20
+ - name : Install Dependencies
18
21
run : |
19
22
sudo apt update
20
- sudo apt install -y libbpf-dev # Install libbpf dependency
21
- sudo apt install -y libseccomp-dev # Install Seccomp dependencies
23
+ sudo apt install -y libbpf-dev
24
+ sudo apt install -y libseccomp-dev
22
25
- name : Build and Test
23
26
run : |
24
27
make build-gh
27
30
with :
28
31
name : harpoon
29
32
path : bin/harpoon
33
+
30
34
release :
31
35
needs : build
32
36
runs-on : ubuntu-latest
44
48
harpoon
45
49
env :
46
50
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51
+
52
+ build-and-push-docker :
53
+ needs : build
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - name : Checkout code
57
+ uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
58
+
59
+ - name : Log in to Docker Hub
60
+ uses : docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # ratchet:docker/login-action@v2
61
+ with :
62
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
63
+ password : ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
64
+
65
+ - name : Build Docker image
66
+ run : make build-docker
67
+
68
+ - name : Push Docker image to Docker Hub
69
+ run : make push-docker
Original file line number Diff line number Diff line change 1
1
BINARY_NAME =harpoon
2
2
BINARY_DIR =./bin
3
3
OUTPUT_DIR =./output
4
+ IMAGE_NAME =alegrey91/harpoon
4
5
5
6
build-static-libbpfgo :
6
7
git clone https://github.com/aquasecurity/libbpfgo.git && \
68
69
.
69
70
70
71
build-docker :
71
- docker build --no-cache -t harpoon:latest .
72
+ ifdef GITHUB_REF_NAME
73
+ docker build \
74
+ --no-cache \
75
+ -t ${IMAGE_NAME}:latest \
76
+ -t ${IMAGE_NAME}:${GITHUB_REF_NAME} \
77
+ .
78
+ endif
79
+ docker build \
80
+ --no-cache \
81
+ -t ${IMAGE_NAME}:latest \
82
+ .
83
+
84
+ push-docker :
85
+ ifdef GITHUB_REF_NAME
86
+ docker push ${IMAGE_NAME}:${GITHUB_REF_NAME}
87
+ docker push ${IMAGE_NAME}:latest
88
+ endif
72
89
73
90
create-bin-dir :
74
91
mkdir -p ${BINARY_DIR}
You can’t perform that action at this time.
0 commit comments