Skip to content

Commit b2efcb0

Browse files
committed
ci: invert cache bool var
1 parent 01a042d commit b2efcb0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ on:
88
branches: [main]
99
workflow_dispatch:
1010
inputs:
11-
no_cache:
12-
description: "Ignore Build cache"
11+
cache:
12+
description: "Use cache"
1313
required: false
14-
default: false
14+
default: true
1515
permissions:
1616
contents: write
1717
pull-requests: write
@@ -25,11 +25,11 @@ jobs:
2525
id: cache
2626
run: |
2727
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
28-
echo "no_cache=${{ inputs.no_cache }}" >> "$GITHUB_OUTPUT"
29-
echo "NO_CACHE=${{ inputs.no_cache }}" >> "$GITHUB_ENV"
28+
echo "cache=${{ inputs.cache }}" >> "$GITHUB_OUTPUT"
29+
echo "CACHE=${{ inputs.cache }}" >> "$GITHUB_ENV"
3030
else
31-
echo "no_cache=false" >> "$GITHUB_OUTPUT"
32-
echo "NO_CACHE=false" >> "$GITHUB_ENV"
31+
echo "cache=true" >> "$GITHUB_OUTPUT"
32+
echo "CACHE=true" >> "$GITHUB_ENV"
3333
fi
3434
- name: Checkout Repository
3535
uses: actions/checkout@v4
@@ -39,7 +39,7 @@ jobs:
3939
- name: Set up Go
4040
uses: actions/setup-go@v5
4141
with:
42-
cache: ${{ steps.cache.outputs.no_cache }}
42+
cache: ${{ steps.cache.outputs.cache }}
4343
go-version: 1.22
4444
- name: Set up release please
4545
id: release

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ GIT_BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD)
99
BUILD_DATE := $(shell date +%Y-%m-%dT%H:%M:%SZ)
1010
IMAGE_NAME ?= ghcr.io/segator/transcoderd
1111
PROJECT_VERSION ?= $(shell cat version.txt)-dev
12-
NO_CACHE ?=false
12+
CACHE ?=true
1313

1414

1515
.DEFAULT: help
@@ -40,7 +40,7 @@ DOCKER_BUILD_ARG := --cache-to type=inline
4040
.PHONY: buildcontainer-%
4141
.PHONY: publishcontainer-%
4242
buildcontainer-% publishcontainer-%:
43-
@export DOCKER_BUILD_ARG="$(DOCKER_BUILD_ARG) $(if $(findstring publishcontainer,$@),--push,--load) $(if $(filter true,$(NO_CACHE)),--no-cache,)"; \
43+
@export DOCKER_BUILD_ARG="$(DOCKER_BUILD_ARG) $(if $(findstring publishcontainer,$@),--push,--load) $(if $(filter false,$(CACHE)),--no-cache,)"; \
4444
docker buildx build \
4545
$${DOCKER_BUILD_ARG} \
4646
--cache-from $(IMAGE_NAME):$*-$(GIT_BRANCH_NAME) \

0 commit comments

Comments
 (0)