File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 3939 - name : Build & Push Docker image
4040 run : |
4141 VERSION=${GITHUB_REF##*/} # extract v0.1.0
42- echo "Building Docker image with version $VERSION"
43- make docker-prod VERSION=$VERSION
44- docker tag leafwiki:$VERSION ghcr.io/${{ github.repository_owner }}/leafwiki:$VERSION
45- docker tag leafwiki:$VERSION ghcr.io/${{ github.repository_owner }}/leafwiki:latest
46- docker push ghcr.io/${{ github.repository_owner }}/leafwiki:$VERSION
47- docker push ghcr.io/${{ github.repository_owner }}/leafwiki:latest
42+ echo "Building Multi-Arch Docker image with version $VERSION"
43+ make docker-build-publish VERSION=$VERSION REPO_OWNER=${{ github.repository_owner }}
4844
4945 - name : Get latest tag before current one
5046 id : latest
Original file line number Diff line number Diff line change @@ -52,9 +52,17 @@ $(PLATFORMS):
5252 echo " 📦 Compressed: zip and tar.gz"
5353
5454# Final production Docker image
55- docker-prod :
56- docker build -f Dockerfile -t leafwiki:$(VERSION ) --target final .
57- docker tag leafwiki:$(VERSION ) leafwiki:latest
55+ docker-build-publish :
56+ ifndef REPO_OWNER
57+ $(error REPO_OWNER is not set. Usage: make docker-build-publish VERSION=vX.Y.Z REPO_OWNER=your_github_username)
58+ endif
59+ docker buildx build \
60+ --platform linux/amd64,linux/arm64 \
61+ --file Dockerfile \
62+ --target final \
63+ --tag ghcr.io/$(REPO_OWNER)/leafwiki:$(VERSION) \
64+ --tag ghcr.io/$(REPO_OWNER)/leafwiki:latest \
65+ --push .
5866
5967help :
6068 @echo " Available commands:"
6371 @echo " make clean – Clean all generated files"
6472 @echo " make test – Run all Go tests"
6573 @echo " make run – Run development server"
66- @echo " make docker-prod – Build final Docker image"
74+ @echo " make docker-build-publish – Build and push multi-arch Docker image"
6775
68- .PHONY : all build run clean test fmt lint help
76+ .PHONY : all build run clean test fmt lint help docker-build-publish
You can’t perform that action at this time.
0 commit comments