Skip to content

Commit

Permalink
Add cache mount for Docker go build step
Browse files Browse the repository at this point in the history
  • Loading branch information
DocDvorak committed Nov 12, 2024
1 parent 702832d commit 61feb40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- main
tags:
- 'v*'

workflow_dispatch:

jobs:
Expand All @@ -32,6 +32,9 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
id: docker_buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0
with:
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ARG ARCH=amd64

WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 \
RUN --mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=${ARCH} \
go build -o screeps-launcher ./cmd/screeps-launcher
Expand Down

0 comments on commit 61feb40

Please sign in to comment.