Add Dockerfile, .dockerignore, and Gitea Actions workflow
Dockerfile: golang:1.24-alpine (pinned by sha256), installs Node.js, npm, golangci-lint (pinned by commit hash), and runs make check as a build step so the image only builds on a green branch. .gitea/workflows/check.yml: runs docker build . on push (actions/checkout pinned by commit sha).
This commit is contained in:
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.git
|
||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
9
.gitea/workflows/check.yml
Normal file
9
.gitea/workflows/check.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
name: check
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# actions/checkout v4.2.2, 2026-02-22
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
- run: docker build .
|
||||||
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
# golang:1.24-alpine, 2025-02-28
|
||||||
|
FROM golang:1.24-alpine@sha256:8bee1901f1e530bfb4a7850aa7a479d17ae3a18beb6e09064ed54cfd245b7191
|
||||||
|
|
||||||
|
# Install system dependencies: Node.js, npm, make, git
|
||||||
|
RUN apk add --no-cache nodejs npm make git
|
||||||
|
|
||||||
|
# Install golangci-lint at a pinned commit hash
|
||||||
|
# golangci-lint v2.10.1 (2025-02-17), commit 5d1e709b7be35cb2025444e19de266b056b7b7ee
|
||||||
|
RUN GOBIN=/usr/local/bin go install \
|
||||||
|
github.com/golangci/golangci-lint/cmd/golangci-lint@5d1e709b7be35cb2025444e19de266b056b7b7ee
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Install frontend dependencies
|
||||||
|
RUN cd frontend && npm ci
|
||||||
|
|
||||||
|
# Run all checks — build fails if the branch is not green
|
||||||
|
RUN make check
|
||||||
Reference in New Issue
Block a user