diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d85c508..262be17 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -123,14 +123,6 @@ jobs: - name: Setup BuildX uses: docker/setup-buildx-action@v3 - - name: Setup cache - uses: actions/cache@v5 - with: - path: /tmp/buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -147,7 +139,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: pull: true context: . @@ -155,5 +147,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=local,src=/tmp/buildx-cache - cache-to: type=local,dest=/tmp/buildx-cache + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index 43d996b..9824196 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,13 @@ RUN set -x \ ca-certificates \ git -COPY . /app +COPY go.mod go.sum /app/ WORKDIR /app +RUN go mod download + +COPY . /app + RUN set -x \ && version="$(git describe --exact-match HEAD 2>/dev/null || git describe --tags --always)" \ && go build \