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