Compare commits
1 Commits
eb75654403
...
66dbcfc751
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66dbcfc751 |
@@ -48,8 +48,6 @@ jobs:
|
|||||||
runs-on: games
|
runs-on: games
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0 # Need full history for git describe
|
|
||||||
|
|
||||||
- name: Sync to deploy directory
|
- name: Sync to deploy directory
|
||||||
run: |
|
run: |
|
||||||
@@ -61,8 +59,4 @@ jobs:
|
|||||||
mkdir -p $DEPLOY_DIR/data
|
mkdir -p $DEPLOY_DIR/data
|
||||||
|
|
||||||
- name: Rebuild and restart
|
- name: Rebuild and restart
|
||||||
run: |
|
run: cd $DEPLOY_DIR && docker compose up -d --build --remove-orphans
|
||||||
cd $DEPLOY_DIR
|
|
||||||
VERSION=$(git describe --tags --always)
|
|
||||||
COMMIT=$(git rev-parse --short HEAD)
|
|
||||||
VERSION=$VERSION COMMIT=$COMMIT docker compose up -d --build --remove-orphans
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
FROM docker.io/golang:1.25.4-alpine AS build
|
FROM docker.io/golang:1.25.4-alpine AS build
|
||||||
|
|
||||||
ARG VERSION=dev
|
RUN apk add --no-cache upx git
|
||||||
ARG COMMIT=unknown
|
|
||||||
|
|
||||||
RUN apk add --no-cache upx
|
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
@@ -14,6 +11,8 @@ RUN go tool templ generate
|
|||||||
RUN go tool gotailwind -i assets/css/input.css -o assets/css/output.css --minify
|
RUN go tool gotailwind -i assets/css/input.css -o assets/css/output.css --minify
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
MODULE=$(head -1 go.mod | awk '{print $2}') && \
|
MODULE=$(head -1 go.mod | awk '{print $2}') && \
|
||||||
|
VERSION=$(git describe --tags --always) && \
|
||||||
|
COMMIT=$(git rev-parse --short HEAD) && \
|
||||||
CGO_ENABLED=0 go build -ldflags="-s -X $MODULE/version.Version=$VERSION -X $MODULE/version.Commit=$COMMIT" -o /bin/games .
|
CGO_ENABLED=0 go build -ldflags="-s -X $MODULE/version.Version=$VERSION -X $MODULE/version.Commit=$COMMIT" -o /bin/games .
|
||||||
RUN upx -9 -k /bin/games
|
RUN upx -9 -k /bin/games
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
games:
|
games:
|
||||||
build:
|
build: .
|
||||||
context: .
|
|
||||||
args:
|
|
||||||
VERSION: ${VERSION:-dev}
|
|
||||||
COMMIT: ${COMMIT:-unknown}
|
|
||||||
container_name: games
|
container_name: games
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user