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:
10
.github/workflows/ci-cd.yml
vendored
10
.github/workflows/ci-cd.yml
vendored
@@ -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 \
|
||||||
.
|
.
|
||||||
|
|||||||
Reference in New Issue
Block a user