1010 runs-on : ubuntu-latest
1111 permissions :
1212 contents : write
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ variant :
17+ - name : ui
18+ tags : ui
19+ suffix : " "
20+ - name : headless
21+ tags : " "
22+ suffix : " -headless"
1323 steps :
1424 - name : Checkout
1525 uses : actions/checkout@v4
@@ -18,24 +28,61 @@ jobs:
1828 with :
1929 go-version-file : " go.mod"
2030
21- - name : Build
22- run : go build -o blossom-linux-amd64 ./cmd/api/main.go
31+ - name : Setup pnpm
32+ if : matrix.variant.name == 'ui'
33+ uses : pnpm/action-setup@v4
34+ with :
35+ version : 9
36+
37+ - name : Setup Node
38+ if : matrix.variant.name == 'ui'
39+ uses : actions/setup-node@v4
40+ with :
41+ node-version : " 22"
42+ cache : pnpm
43+ cache-dependency-path : ui/pnpm-lock.yaml
44+
45+ - name : Build UI
46+ if : matrix.variant.name == 'ui'
47+ working-directory : ui
48+ run : |
49+ pnpm install --frozen-lockfile
50+ pnpm build
51+
52+ - name : Build binary
53+ run : |
54+ go build -tags "${{ matrix.variant.tags }}" \
55+ -o blossom-linux-amd64${{ matrix.variant.suffix }} \
56+ ./cmd/api/main.go
2357
2458 - name : Release
2559 uses : softprops/action-gh-release@v2
2660 with :
2761 token : ${{ secrets.GITHUB_TOKEN }}
28- files : blossom-linux-amd64
62+ files : blossom-linux-amd64${{ matrix.variant.suffix }}
2963
3064 docker :
3165 runs-on : ubuntu-latest
3266 permissions :
3367 contents : read
3468 packages : write
69+ strategy :
70+ fail-fast : false
71+ matrix :
72+ variant :
73+ - name : ui
74+ target : runtime-ui
75+ suffix : " "
76+ - name : headless
77+ target : runtime-headless
78+ suffix : " -headless"
3579 steps :
3680 - name : Checkout
3781 uses : actions/checkout@v4
3882
83+ - name : Set up Buildx
84+ uses : docker/setup-buildx-action@v3
85+
3986 - name : Log in to ghcr.io
4087 uses : docker/login-action@v3
4188 with :
4895 uses : docker/metadata-action@v5
4996 with :
5097 images : ghcr.io/${{ github.repository }}
98+ flavor : |
99+ suffix=${{ matrix.variant.suffix }},onlatest=true
51100 tags : |
52101 type=semver,pattern={{version}}
53102 type=semver,pattern={{major}}.{{minor}}
57106 with :
58107 context : .
59108 push : true
109+ target : ${{ matrix.variant.target }}
60110 tags : ${{ steps.meta.outputs.tags }}
61111 labels : ${{ steps.meta.outputs.labels }}
112+ cache-from : type=gha,scope=${{ matrix.variant.name }}
113+ cache-to : type=gha,mode=max,scope=${{ matrix.variant.name }}
0 commit comments