File tree 6 files changed +77
-12
lines changed
6 files changed +77
-12
lines changed Original file line number Diff line number Diff line change
1
+ name : Build images for CI
2
+
3
+ on :
4
+ pull_request :
5
+ branches : [master]
6
+
7
+ jobs :
8
+ lint :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - name : Checkout
12
+ uses : actions/checkout@v3
13
+
14
+ - name : Build the dashboard image
15
+ run : make image
16
+
17
+ - name : Build the pixiu aio image
18
+ run : make image-aio
Original file line number Diff line number Diff line change 19
19
- run : npm ci # 下载包
20
20
- run : npm run prettier # 格式化
21
21
- run : npm run lint # eslint检查
22
-
23
- - name : Build the Docker image
24
- run : make image
Original file line number Diff line number Diff line change 1
- name : Publish dashboard image
1
+ name : Publish dashboard and pixiu aio images
2
2
3
3
on :
4
4
push :
9
9
runs-on : ubuntu-latest
10
10
11
11
steps :
12
- - uses : actions/checkout@v3
12
+ - name : Checkout
13
+ uses : actions/checkout@v3
13
14
14
- - name : Login in dockerhub
15
- uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
16
- with :
17
- username : jacky06
18
- password : jacky06jacky06
15
+ - name : Get short commit hash
16
+ run : |
17
+ echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
18
+ echo "TIMESTAMP=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
19
19
20
- - name : Build and push the Docker image
21
- run : make image && make push
20
+ - name : Set up QEMU
21
+ uses : docker/setup-qemu-action@v3
22
+
23
+ - name : Set up Docker Buildx
24
+ uses : docker/setup-buildx-action@v3
25
+
26
+ - name : Login in dockerhub
27
+ uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
28
+ with :
29
+ username : jacky06
30
+ password : jacky06jacky06
31
+
32
+ - name : Build and push dashboard image
33
+ run : make push
34
+
35
+ - name : Build and push pixiu aio image
36
+ run : make push-aio
Original file line number Diff line number Diff line change @@ -21,5 +21,11 @@ image:
21
21
push : image
22
22
docker push ${dockerhubUser} /${releaseName} :${tag}
23
23
24
+ image-aio :
25
+ docker build -t ${dockerhubUser} /pixiu-aio:${tag} --platform=linux -f docker/Dockerfile-aio .
26
+
27
+ push-aio : image-aio
28
+ docker push ${dockerhubUser} /pixiu-aio:${tag}
29
+
24
30
clean :
25
31
-rm -rf ./dist ./node_modules
Original file line number Diff line number Diff line change
1
+ FROM golang:1.17 as pixiu-builder
2
+ WORKDIR /app
3
+ ARG VERSION
4
+ ENV GOPROXY=https://goproxy.cn
5
+ RUN git clone https://github.com/caoyingjunz/pixiu.git && cp -r pixiu/* . && rm -rf pixiu
6
+ RUN CGO_ENABLED=0 go build -ldflags "-s -w -X 'main.version=${VERSION}'" -o pixiu ./cmd
7
+
8
+ FROM node:16.18.0-alpine as builder
9
+ LABEL MAINTAINER="PIXIU"
10
+ WORKDIR /build
11
+ COPY . .
12
+ RUN npm config set registry https://registry.npmmirror.com/ && npm install && npm run build
13
+
14
+ FROM nginx:alpine
15
+ LABEL MAINTAINER="PIXIU"
16
+ COPY --from=builder /build/dist /usr/share/nginx/html/pixiu
17
+ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
18
+ COPY --from=pixiu-builder /app/pixiu /app
19
+ COPY docker/start.sh /usr/local/bin/pixiu_start
20
+
21
+ CMD ['pixiu_start']
Original file line number Diff line number Diff line change
1
+ set -o errexit
2
+ set -o xtrace
3
+
4
+ echo " Starting pixiu dashboard service"
5
+ nginx -g ' daemon on;'
6
+
7
+ echo " Starting pixiu backend service"
8
+ /app
You can’t perform that action at this time.
0 commit comments