-
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
1 parent
4ce0754
commit 4c9af7f
Showing
3 changed files
with
13 additions
and
23 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 |
---|---|---|
|
@@ -45,24 +45,6 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-buildx | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: ./back/go.mod | ||
cache: true | ||
cache-dependency-path: ./back/go.sum | ||
|
||
- name: go mod download | ||
run: go mod download | ||
working-directory: ./back | ||
|
||
- name: go build | ||
working-directory: ./back | ||
env: | ||
CGO_ENABLED: 0 | ||
GOOS: linux | ||
run: go build -o server main.go | ||
|
||
- name: Build and push Docker images | ||
uses: docker/[email protected] | ||
if: github.event_name != 'release' | ||
|
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,11 +1,19 @@ | ||
# run before CGO_ENABLED=0 GOOS=linux go build -o server $ROOT/main.go && chmod +x ./server | ||
FROM golang:1.21 as builder | ||
ENV ROOT=/build | ||
RUN mkdir ${ROOT} | ||
WORKDIR ${ROOT} | ||
|
||
COPY ./back ./ | ||
RUN go get | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o server main.go && chmod +x ./server | ||
|
||
FROM alpine:3 | ||
WORKDIR /app | ||
|
||
COPY back/server ./ | ||
RUN chmod +x ./server | ||
COPY back/zoneinfo/Asia/Tokyo /usr/share/zoneinfo/Asia/Tokyo | ||
|
||
COPY --from=builder /build/server ./ | ||
COPY --from=builder /build/templates/ /app/templates/ | ||
COPY --from=builder /build/assets/ /app/assets/ | ||
COPY --from=builder /usr/share/zoneinfo/Asia/Tokyo /usr/share/zoneinfo/Asia/Tokyo | ||
CMD ["./server"] | ||
LABEL org.opencontainers.image.source = "https://github.com/walnuts1018/openchokin" |
Binary file not shown.