Skip to content

Commit e2de2c7

Browse files
committed
Gate Docker build on CI passing, fix frontend embed in test job
1 parent a1368ef commit e2de2c7

2 files changed

Lines changed: 39 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: read
11+
packages: write
1112

1213
jobs:
1314
test:
@@ -27,8 +28,46 @@ jobs:
2728
- name: Typecheck frontend
2829
run: cd frontend && bunx tsc -b --noEmit
2930

31+
- name: Build frontend
32+
run: |
33+
cd frontend && bun run build
34+
cp -r dist ../internal/frontend/dist
35+
3036
- name: Go vet
3137
run: go vet ./...
3238

3339
- name: Go test
3440
run: go test ./...
41+
42+
docker:
43+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
44+
needs: test
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- uses: docker/setup-buildx-action@v3
50+
51+
- uses: docker/login-action@v3
52+
with:
53+
registry: ghcr.io
54+
username: ${{ github.actor }}
55+
password: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- uses: docker/metadata-action@v5
58+
id: meta
59+
with:
60+
images: ghcr.io/${{ github.repository }}
61+
tags: |
62+
type=raw,value=main
63+
type=sha,prefix=sha-
64+
65+
- uses: docker/build-push-action@v6
66+
with:
67+
context: .
68+
push: true
69+
platforms: linux/amd64,linux/arm64
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
cache-from: type=gha
73+
cache-to: type=gha,mode=max

.github/workflows/docker.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)