File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 2020 submodules : recursive
2121 - name : Set up QEMU integration for Docker
2222 run : docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
23+ - name : Login to GitHub Container Registry
24+ uses : docker/login-action@v3
25+ with :
26+ registry : ghcr.io
27+ username : ${{ github.actor }}
28+ password : ${{ secrets.GITHUB_TOKEN }}
2329 - name : Build AppImage in Docker
2430 run : bash -ex ci/build-in-docker.sh
2531 - name : Archive artifacts
Original file line number Diff line number Diff line change @@ -31,11 +31,26 @@ CMAKE_ARCH="${CMAKE_ARCH:-"$ARCH"}"
3131cwd=" $PWD "
3232repo_root=" $( readlink -f " $( dirname " $0 " ) " /..) "
3333
34- # needed to keep user ID in and outside Docker in sync to be able to write to workspace directory
35- image=appimageupdate-build
34+ image=ghcr.io/appimage/appimageupdate-build
35+ cache_image=" ${image} -cache"
36+
37+ # push only on default branch
38+ if [[ " ${GITHUB_ACTIONS:- } " ]]; then
39+ echo " Building on GitHub actions, checking if on default branch"
40+ if [[ " refs/heads/${GITHUB_HEAD_REF} " == " ${GITHUB_DEFAULT_BRANCH} " ]]; then
41+ echo " Building on default branch, pushing to cache"
42+ cache_build_args+=(
43+ --cache-to type=" registry,ref=$cache_image "
44+ --push
45+ )
46+ fi
47+ else
48+ echo " Not building on GitHub actions, not publishing cache"
49+ fi
3650
3751# building local image to "cache" installed dependencies for subsequent builds
3852docker build \
53+ --cache-from " type=registry,ref=$cache_image " \
3954 --platform " $docker_platform " \
4055 -t " $image " \
4156 --build-arg ARCH=" $ARCH " \
You can’t perform that action at this time.
0 commit comments