chore(ci): add Docker buildx layer caching to CI/CD workflow

Enable registry-based caching for Docker builds by adding
--cache-from and --cache-to flags. This reuses cached layers
from previous builds to speed up build times and reduce network
usage.
This commit is contained in:
db123-test
2026-05-04 13:34:39 +03:30
parent a281012fc4
commit fc31ca3d86

View File

@@ -35,13 +35,13 @@ jobs:
# steps: # steps:
# - name: Checkout repo # - name: Checkout repo
# run: git clone "${{ secrets.G_CLONE_URL }}" . # run: git clone "${{ secrets.G_CLONE_URL }}" .
#
# - name: Build for Linux amd64 # - name: Build for Linux amd64
# run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-linux-amd64 . # run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-linux-amd64 .
#
# - name: Build for Windows amd64 # - name: Build for Windows amd64
# run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-windows-amd64.exe # run: CGO_ENABLED=0 GOOS=windows GOARCH=amd64 /usr/local/go/bin/go build -o auth-proxy-windows-amd64.exe
#
# - name: Package binaries # - name: Package binaries
# run: | # run: |
# tar czf auth-proxy-linux-amd64.tar.gz auth-proxy-linux-amd64 # tar czf auth-proxy-linux-amd64.tar.gz auth-proxy-linux-amd64
@@ -70,5 +70,7 @@ jobs:
--platform linux/amd64 \ --platform linux/amd64 \
--tag "git.yejayekhoob.com/db123/auth-proxy:${{ github.sha }}" \ --tag "git.yejayekhoob.com/db123/auth-proxy:${{ github.sha }}" \
--tag "git.yejayekhoob.com/db123/auth-proxy:latest" \ --tag "git.yejayekhoob.com/db123/auth-proxy:latest" \
--cache-from=type=registry,ref=git.yejayekhoob.com/db123/auth-proxy:cache \
--cache-to=type=registry,ref=git.yejayekhoob.com/db123/auth-proxy:cache,mode=max \
--push \ --push \
. .