66 workflow_dispatch :
77
88jobs :
9- build :
9+ frontend- build :
1010 runs-on : ubuntu-22.04
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4.2.2
14+ with :
15+ submodules : recursive
16+ - name : Set up Node.js
17+ uses : actions/setup-node@v4
18+ with :
19+ node-version : 20
20+ - name : Install dependencies and build frontend
21+ run : |
22+ cd frontend
23+ npm install
24+ npm run build
25+ - name : Upload frontend build artifact
26+ uses : actions/upload-artifact@v4
27+ with :
28+ name : frontend-dist
29+ path : frontend/dist/
1130
31+ build :
32+ needs : frontend-build
33+ runs-on : ubuntu-22.04
1234 steps :
1335 - name : Checkout repository
1436 uses : actions/checkout@v4.2.2
37+ - name : Download frontend build artifact
38+ uses : actions/download-artifact@v4
1539 with :
16- submodules : recursive
17-
40+ name : frontend-dist
41+ path : frontend_dist
1842 - name : Docker meta
1943 id : meta
2044 uses : docker/metadata-action@v5
@@ -26,31 +50,39 @@ jobs:
2650 type=ref,event=branch
2751 type=ref,event=tag
2852 type=pep440,pattern={{version}}
29-
3053 - name : Set up QEMU
3154 uses : docker/setup-qemu-action@v3
32-
3355 - name : Set up Docker Buildx
3456 uses : docker/setup-buildx-action@v3
35-
57+ with :
58+ install : true
59+ buildkitd-flags : --debug
60+ - name : Cache Docker layers
61+ uses : actions/cache@v4
62+ with :
63+ path : /tmp/.buildx-cache
64+ key : ${{ runner.os }}-buildx-${{ github.sha }}
65+ restore-keys : |
66+ ${{ runner.os }}-buildx-
3667 - name : Login to Docker Hub
3768 uses : docker/login-action@v3
3869 with :
3970 username : ${{ secrets.DOCKER_HUB_USERNAME }}
4071 password : ${{ secrets.DOCKER_HUB_TOKEN }}
41-
4272 - name : Login to GHCR
4373 uses : docker/login-action@v3
4474 with :
4575 registry : ghcr.io
4676 username : ${{ github.repository_owner }}
4777 password : ${{ secrets.GITHUB_TOKEN }}
48-
4978 - name : Build and push
5079 uses : docker/build-push-action@v6
5180 with :
5281 context : .
82+ file : Dockerfile.frontend-artifact
5383 push : true
54- platforms : linux/amd64, linux/arm64/v8, linux/arm/v7, linux/arm/v6, linux/386
84+ platforms : linux/amd64, linux/386, linux/ arm64/v8, linux/arm/v7, linux/arm/v6
5585 tags : ${{ steps.meta.outputs.tags }}
56- labels : ${{ steps.meta.outputs.labels }}
86+ labels : ${{ steps.meta.outputs.labels }}
87+ cache-from : type=local,src=/tmp/.buildx-cache
88+ cache-to : type=local,dest=/tmp/.buildx-cache,mode=max
0 commit comments