all: do not commit generated JS/CSS to source control (#148)

Closes #125
Closes #40

Among other things, this moves all of the asset generation to run within
the context of an npm script. Developer documentation stubs have been
added so that people can get started more easily.

The top-level Dockerfile (which is no longer used in production) has
been removed as its presence has been causing confusion. This changeset
will break it anyways.

These changes will make for less "repo churn" as the static assets are
built and rebuilt, at the cost of making the build step more complicated
for downstream packagers. If this becomes a burden, we can explore
making a "release tarball" that contains pre-massaged outputs.
This commit is contained in:
Xe Iaso 2025-03-28 14:55:25 -04:00 committed by GitHub
parent bb4f49cfd9
commit 937f1dd330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 223 additions and 77 deletions

View file

@ -20,11 +20,29 @@ jobs:
fetch-tags: true
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.24.x'
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- uses: ko-build/setup-ko@v0.8
- name: Setup Homebrew cellar cache
uses: actions/cache@v4
with:
path: |
/home/linuxbrew/.linuxbrew/Cellar
/home/linuxbrew/.linuxbrew/bin
/home/linuxbrew/.linuxbrew/etc
/home/linuxbrew/.linuxbrew/include
/home/linuxbrew/.linuxbrew/lib
/home/linuxbrew/.linuxbrew/opt
/home/linuxbrew/.linuxbrew/sbin
/home/linuxbrew/.linuxbrew/share
/home/linuxbrew/.linuxbrew/var
key: ${{ runner.os }}-go-homebrew-cellar-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-homebrew-cellar-
- name: Install Brew dependencies
run: |
brew bundle
- name: Docker meta
id: meta
@ -35,9 +53,12 @@ jobs:
- name: Build and push
id: build
run: |
go run ./cmd/containerbuild --docker-repo ghcr.io/techarohq/anubis --slog-level debug
npm ci
npm run container
env:
PULL_REQUEST_ID: ${{ github.event.number }}
DOCKER_REPO: ghcr.io/techarohq/anubis
SLOG_LEVEL: debug
- run: |
echo "Test this with:"

View file

@ -26,11 +26,29 @@ jobs:
fetch-tags: true
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.24.x'
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- uses: ko-build/setup-ko@v0.8
- name: Setup Homebrew cellar cache
uses: actions/cache@v4
with:
path: |
/home/linuxbrew/.linuxbrew/Cellar
/home/linuxbrew/.linuxbrew/bin
/home/linuxbrew/.linuxbrew/etc
/home/linuxbrew/.linuxbrew/include
/home/linuxbrew/.linuxbrew/lib
/home/linuxbrew/.linuxbrew/opt
/home/linuxbrew/.linuxbrew/sbin
/home/linuxbrew/.linuxbrew/share
/home/linuxbrew/.linuxbrew/var
key: ${{ runner.os }}-go-homebrew-cellar-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-homebrew-cellar-
- name: Install Brew dependencies
run: |
brew bundle
- name: Log into registry
uses: docker/login-action@v3
@ -48,11 +66,14 @@ jobs:
- name: Build and push
id: build
run: |
go run ./cmd/containerbuild --docker-repo ghcr.io/techarohq/anubis --slog-level debug
npm ci
npm run container
env:
DOCKER_REPO: ghcr.io/techarohq/anubis
SLOG_LEVEL: debug
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
if: ${{github.event_name == 'pull_request'}}
with:
subject-name: ghcr.io/techarohq/anubis
subject-digest: ${{ steps.build.outputs.digest }}

View file

@ -69,8 +69,13 @@ jobs:
npx --yes playwright@1.50.1 install --with-deps
npx --yes playwright@1.50.1 run-server --port 3000 &
- name: install node deps
run: |
npm ci
npm run assets
- name: Build
run: go build ./...
- name: Test
run: go test -v ./...
run: npm run test