File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,23 @@ repo_root="$(readlink -f "$(dirname "$0")"/..)"
3434# use docker image tag provided by GitHub actions if possible
3535DOCKER_TAG=" ${DOCKER_TAG:- ghcr.io/ appimage/ appimageupdate-build: local-build} "
3636
37- default_branch_tag=" $( echo " $DOCKER_TAG " | cut -d: -f1) :$( echo " $GITHUB_DEFAULT_BRANCH " | rev | cut -d/ -f1 | rev) "
37+ default_branch_tag=" $( echo " $DOCKER_TAG " | cut -d: -f1) :$( echo " ${GITHUB_DEFAULT_BRANCH:- main} " | rev | cut -d/ -f1 | rev) "
38+
39+ extra_build_args=()
40+
41+ if [[ " ${GITHUB_ACTIONS:- } " != " " ]]; then
42+ echo " Building on GitHub actions, pushing cache"
43+ extra_build_args+=(
44+ --output " type=registry,ref=${DOCKER_TAG} "
45+ --push
46+ )
47+ else
48+ echo " Local build, not pushing cache"
49+ fi
3850
3951# building local image to "cache" installed dependencies for subsequent builds
40- docker build \
41- --cache-to inline \
52+ docker buildx build \
53+ " ${extra_build_args[@]} " \
4254 --cache-from " type=registry,ref=${DOCKER_TAG} " \
4355 --cache-from " type=registry,ref=${default_branch_tag} " \
4456 --platform " $docker_platform " \
You can’t perform that action at this time.
0 commit comments