File tree Expand file tree Collapse file tree 3 files changed +68
-15
lines changed
Expand file tree Collapse file tree 3 files changed +68
-15
lines changed Original file line number Diff line number Diff line change 11name : Build
22on :
33 push :
4- tags :
5- - ' * '
4+ branches :
5+ - master
66jobs :
7- release :
7+ build :
88 runs-on : ubuntu-latest
9+ name : Build
910 steps :
1011 - uses : actions/checkout@v3
12+ - uses : google-github-actions/auth@v1
13+ id : auth
1114 with :
12- fetch-depth : 0
13- - uses : actions/setup-go@v4
15+ credentials_json : ${{ secrets.GOOGLE_CREDENTIALS }}
16+ token_format : access_token
17+ - uses : docker/login-action@v1
1418 with :
15- go-version : " ^1.20"
16- - uses : goreleaser/goreleaser-action@v4
19+ registry : asia-southeast1-docker.pkg.dev
20+ username : oauth2accesstoken
21+ password : ${{ steps.auth.outputs.access_token }}
22+ - uses : docker/setup-buildx-action@v2
1723 with :
1824 version : latest
19- args : release --clean
20- env :
21- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
22- - uses : actions/upload-artifact@v3
25+ - uses : docker/build-push-action@v4
2326 with :
24- name : deploys
25- path : dist/*
26- env :
27- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27+ provenance : false
28+ push : true
29+ tags : asia-southeast1-docker.pkg.dev/deploys-app/public/cli:${{ github.sha }}
Original file line number Diff line number Diff line change 1+ name : Release
2+ on :
3+ push :
4+ tags :
5+ - ' *'
6+ jobs :
7+ release :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - uses : actions/checkout@v3
11+ with :
12+ fetch-depth : 0
13+ - uses : actions/setup-go@v4
14+ with :
15+ go-version : " ^1.21"
16+ - uses : goreleaser/goreleaser-action@v4
17+ with :
18+ version : latest
19+ args : release --clean
20+ env :
21+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
22+ - uses : actions/upload-artifact@v3
23+ with :
24+ name : deploys
25+ path : dist/*
26+ env :
27+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ FROM golang:1.21.4
2+
3+ ENV CGO_ENABLED=0
4+
5+ WORKDIR /workspace
6+
7+ ADD go.mod go.sum ./
8+ RUN go mod download
9+ ADD . .
10+ RUN go build -o .build/deploys -ldflags "-w -s" .
11+
12+ FROM debian:11-slim
13+
14+ RUN apt-get update && apt-get install -y \
15+ ca-certificates \
16+ && rm -rf /var/lib/apt/lists/*
17+
18+ ENV PATH "$PATH:/app"
19+
20+ WORKDIR /app
21+
22+ COPY --from=0 --link /workspace/.build/* ./
23+ ADD ./entrypoint.sh ./entrypoint.sh
24+ ENTRYPOINT ["entrypoint.sh" ]
You can’t perform that action at this time.
0 commit comments