This repository has been archived by the owner on Dec 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web/* linguist-vendored | ||
web/* linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build Docker Image | ||
|
||
on: | ||
push: | ||
# trigger on any tag push | ||
tags: | ||
- "**" | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get Tag Version | ||
id: get_version | ||
run: | | ||
export TRUNCATED_GITHUB_SHA=$(echo ${{ github.sha }} | cut -c1-7); | ||
echo "VERSION=${GITHUB_REF/refs\/tags\//}+${TRUNCATED_GITHUB_SHA}" >> $GITHUB_ENV | ||
echo "GIT_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
- name: Build and Publish to Registry | ||
uses: elgohr/[email protected] | ||
with: | ||
name: penguin-statistics/probe | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ghcr.io | ||
tags: "latest,${{ env.GIT_TAG }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM golang:1.18.1-alpine AS base | ||
WORKDIR /app | ||
|
||
# builder | ||
FROM base AS gobuilder | ||
ENV GOOS linux | ||
ENV GOARCH amd64 | ||
|
||
# go 1.18 requires git | ||
RUN apk add --no-cache git | ||
|
||
# modules: utilize build cache | ||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
|
||
# RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct | ||
RUN go mod download | ||
COPY . . | ||
|
||
# build the binary | ||
RUN go build -o probe . | ||
|
||
# runner | ||
FROM base AS runner | ||
RUN apk add --no-cache libc6-compat tini | ||
# Tini is now available at /sbin/tini | ||
|
||
COPY --from=gobuilder /app/probe /app/probe | ||
COPY --from=gobuilder /app/config.example.yml /app/config.yml | ||
|
||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD [ "/app/probe" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/penguin-statistics/probe/cmd" | ||
|
||
func main() { | ||
cmd.Bootstrap() | ||
} |