File tree 4 files changed +62
-9
lines changed
4 files changed +62
-9
lines changed Original file line number Diff line number Diff line change
1
+ name : ci
2
+
3
+ on : [push]
4
+
5
+ jobs :
6
+ build :
7
+
8
+ runs-on : ubuntu-latest
9
+ strategy :
10
+ matrix :
11
+ go-version : [ '1.20', '1.21.x' ]
12
+
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - name : Setup Go ${{ matrix.go-version }}
16
+ uses : actions/setup-go@v4
17
+ with :
18
+ go-version : ${{ matrix.go-version }}
19
+ - name : Install dependencies
20
+ run : go get .
21
+ - name : Build
22
+ run : go build -v ./...
23
+ - name : Test with the Go CLI
24
+ run : go test
Original file line number Diff line number Diff line change
1
+ name : release
2
+
3
+ on :
4
+ create
5
+
6
+ jobs :
7
+ docker :
8
+ if : ${{ startsWith(github.ref, 'refs/tags/v') }}
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ -
12
+ name : Set up QEMU
13
+ uses : docker/setup-qemu-action@v3
14
+ -
15
+ name : Set up Docker Buildx
16
+ uses : docker/setup-buildx-action@v3
17
+ -
18
+ name : Login to Docker Hub
19
+ uses : docker/login-action@v3
20
+ with :
21
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
22
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
23
+ -
24
+ name : Build and push
25
+ uses : docker/build-push-action@v5
26
+ with :
27
+ push : true
28
+ tags : hakindazz/s6-cli:latest
Original file line number Diff line number Diff line change 1
- # Stage 1: Build the Go binary
2
- FROM golang:1.17 AS builder
1
+ # build stage
2
+ FROM golang:1.20.12-alpine3.19 as builder
3
+
4
+ ENV GO111MODULE=on
3
5
4
- # Set the working directory inside the container
5
6
WORKDIR /app
6
7
7
- # Copy the go.mod and go.sum files to download dependencies
8
- COPY go.mod go. sum ./
8
+ COPY go.mod .
9
+ COPY go.sum .
9
10
10
- # Download dependencies
11
11
RUN go mod download
12
12
13
- # Copy the source code into the container
14
13
COPY . .
15
14
16
- # Build the Go binary
17
- RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o s6-cli .
15
+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o s6-cli -v ./cmd/s6cli
16
+
18
17
19
18
# Stage 2: Create a minimal image for running the binary
20
19
FROM scratch
Original file line number Diff line number Diff line change 66
66
# RUN COMMANDS OF CLI WITH DEFAULT ARGS
67
67
# ==================================================================================== #
68
68
69
+ # # lint: lint s6-overlay folders and files
69
70
.PHONY : lint
70
71
lint :
71
72
@go run ./cmd/s6cli $(ARGS ) lint
72
73
74
+ # # mermaid: generate mermaid graph
73
75
.PHONY : mermaid
74
76
mermaid :
75
77
@go run ./cmd/s6cli $(ARGS ) mermaid
You can’t perform that action at this time.
0 commit comments