From a8e6e2763e8fb6bbfd47a5f7865442a58744cd17 Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Sat, 5 Sep 2026 14:17:12 +1000 Subject: [PATCH] Add CI/Docker stuff --- .gitea/workflows/build.yml | 39 ++++++++++++++++++++++++++++++++++++++ Dockerfile | 7 +++++++ caddy/Caddyfile | 9 +++++++++ 3 files changed, 55 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 Dockerfile create mode 100644 caddy/Caddyfile diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 00000000..c65aef1f --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build and Push Docker Image + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + container: + options: --cap-add=NET_ADMIN --device=/dev/net/tun + + steps: + - name: Tailscale + uses: tailscale/github-action@v4 + with: + authkey: ${{ secrets.TAILSCALE_AUTHKEY }} + ping: rose-library,gitea + version: latest + use-cache: 'false' + + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker Login + uses: docker/login-action@v2 + with: + registry: gitea.allosaurus-chromatic.ts.net + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Docker Build + run: | + docker build -t gitea.allosaurus-chromatic.ts.net/tlecommunity/app:latest . --provenance=false --platform=linux/amd64 + + - name: Docker Push + run: | + docker push gitea.allosaurus-chromatic.ts.net/tlecommunity/app:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c3c85e92 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:22-alpine AS builder +COPY . /app +RUN cd /app && npm install && npm run build + +FROM caddy:latest +COPY --from=builder /app/dist /srv/app +COPY ./caddy /etc/caddy diff --git a/caddy/Caddyfile b/caddy/Caddyfile new file mode 100644 index 00000000..e05c0582 --- /dev/null +++ b/caddy/Caddyfile @@ -0,0 +1,9 @@ +http://localhost:3000 { + log { + output stdout + format console + } + + root * /srv/app + file_server +} -- 2.51.2