Skip to content

Commit

Permalink
ci: disable cache on release
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Feb 1, 2023
1 parent 079e422 commit 1985212
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,18 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set cache attributes
if: "!startsWith(github.ref, 'refs/tags/v')"
run: |
echo "CACHE_FROM=type=gha,scope=${{ env.CACHE_GHA_SCOPE_CROSS }} type=gha,scope=image${{ matrix.target-stage }}" >>${GITHUB_ENV}
echo "CACHE_TO=type=gha,scope=image${{ matrix.target-stage }}" >>${GITHUB_ENV}
-
name: Build ${{ needs.release-base.outputs.tag }}
run: |
./hack/images "${{ needs.release-base.outputs.tag }}" "$REPO_SLUG_TARGET" "${{ needs.release-base.outputs.push }}"
env:
TARGET: ${{ matrix.target-stage }}
CACHE_FROM: type=gha,scope=${{ env.CACHE_GHA_SCOPE_CROSS }} type=gha,scope=image${{ matrix.target-stage }}
CACHE_TO: type=gha,scope=image${{ matrix.target-stage }}

binaries:
runs-on: ubuntu-20.04
Expand All @@ -414,13 +418,17 @@ jobs:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
buildkitd-flags: --debug
-
name: Set cache attributes
if: "!startsWith(github.ref, 'refs/tags/v')"
run: |
echo "CACHE_FROM=type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_CROSS }}" >>${GITHUB_ENV}
-
name: Build ${{ needs.release-base.outputs.tag }}
run: |
./hack/release-tar "${{ needs.release-base.outputs.tag }}" release-out
env:
PLATFORMS: ${{ env.PLATFORMS }},darwin/amd64,darwin/arm64,windows/amd64,windows/arm64
CACHE_FROM: type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_CROSS }}
-
name: Upload artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -493,19 +501,28 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set cache attributes
if: "!startsWith(github.ref, 'refs/tags/v')"
run: |
echo "CACHE_FROM=type=gha,scope=frontend-${{ needs.frontend-base.outputs.typ }}" >>${GITHUB_ENV}
echo "CACHE_TO=type=gha,scope=frontend-${{ needs.frontend-base.outputs.typ }}" >>${GITHUB_ENV}
-
name: Build ${{ needs.frontend-base.outputs.typ }}/${{ needs.frontend-base.outputs.tag }}
run: |
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.frontend-base.outputs.typ }}" "${{ needs.frontend-base.outputs.tag }}" "$DF_REPO_SLUG_TARGET" "${{ needs.frontend-base.outputs.push }}"
env:
PLATFORMS: ${{ env.PLATFORMS }},linux/386,linux/mips,linux/mipsle,linux/mips64,linux/mips64le
CACHE_FROM: type=gha,scope=frontend-${{ needs.frontend-base.outputs.typ }}
CACHE_TO: type=gha,scope=frontend-${{ needs.frontend-base.outputs.typ }}
-
name: Set cache attributes
if: "!startsWith(github.ref, 'refs/tags/v')"
run: |
# we don't want to cache the labs image
echo "CACHE_TO=" >>${GITHUB_ENV}
-
name: Build ${{ needs.frontend-base.outputs.typ }}/labs
if: needs.frontend-base.outputs.typ == 'master'
run: |
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.frontend-base.outputs.typ }}" labs "$DF_REPO_SLUG_TARGET" "${{ needs.frontend-base.outputs.push }}"
env:
PLATFORMS: ${{ env.PLATFORMS }},linux/386,linux/mips,linux/mipsle,linux/mips64,linux/mips64le
CACHE_FROM: type=gha,scope=frontend-${{ needs.frontend-base.outputs.typ }}

0 comments on commit 1985212

Please sign in to comment.