diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..1d65994 --- /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/super-ui:latest . --provenance=false --platform=linux/amd64 + + - name: Docker Push + run: | + docker push gitea.allosaurus-chromatic.ts.net/tlecommunity/super-ui:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9f1bdf0 --- /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/packages/web/dist/ /srv/super-ui +COPY ./caddy /etc/caddy diff --git a/caddy/Caddyfile b/caddy/Caddyfile new file mode 100644 index 0000000..58c5a63 --- /dev/null +++ b/caddy/Caddyfile @@ -0,0 +1,9 @@ +http://localhost:3000 { + log { + output stdout + format console + } + + root * /srv/super-ui + file_server +}