Skip to content

Commit b3affa1

Browse files
authored
ci: add missing GOCACHE and GOPATH in release worflow (#6192)
1 parent c4eb934 commit b3affa1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/release.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ jobs:
8181
echo "" >> $GITHUB_ENV
8282
echo 'type=raw,value=${{ steps.semver_parser.outputs.major }}.${{ steps.semver_parser.outputs.minor }}' >> $GITHUB_ENV
8383
echo 'EOF' >> $GITHUB_ENV
84+
# Setup Golang to use go pkg cache which is utilized in Dockerfile's cache mount.
85+
- name: Setup golang
86+
uses: actions/setup-go@v5
87+
with:
88+
go-version-file: go.mod
89+
- run: echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
90+
- run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
8491
- name: Set up Docker Buildx
8592
uses: docker/setup-buildx-action@v3
8693
- name: Cache Docker layers
@@ -117,6 +124,8 @@ jobs:
117124
TAG=${{ steps.meta.outputs.version }}
118125
COMMIT=${{ github.sha }}
119126
REPO_INFO=https://github.com/${{ github.repository }}.git
127+
GOPATH=${{ env.GOPATH}}
128+
GOCACHE=${{ env.GOCACHE}}
120129
- name: Build and push distroless image to DockerHub
121130
id: docker_build
122131
uses: docker/build-push-action@v5
@@ -131,6 +140,8 @@ jobs:
131140
TAG=${{ steps.meta.outputs.version }}
132141
COMMIT=${{ github.sha }}
133142
REPO_INFO=https://github.com/${{ github.repository }}.git
143+
GOPATH=${{ env.GOPATH}}
144+
GOCACHE=${{ env.GOCACHE}}
134145
135146
test-e2e:
136147
needs: [verify-manifest-tag, build-push-images]

0 commit comments

Comments
 (0)