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")"/..)"
34
34
# use docker image tag provided by GitHub actions if possible
35
35
DOCKER_TAG=" ${DOCKER_TAG:- ghcr.io/ appimage/ appimageupdate-build: local-build} "
36
36
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
38
50
39
51
# 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[@]} " \
42
54
--cache-from " type=registry,ref=${DOCKER_TAG} " \
43
55
--cache-from " type=registry,ref=${default_branch_tag} " \
44
56
--platform " $docker_platform " \
You can’t perform that action at this time.
0 commit comments