Skip to content

Commit 0f42b17

Browse files
committed
fixup! fixup! fixup! fixup! fixup! Cache Docker images on GitHub container registry
1 parent 634ada3 commit 0f42b17

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ jobs:
3535
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3636
- name: Build AppImage in Docker
3737
run: bash -ex ci/build-in-docker.sh
38-
env:
39-
DOCKER_TAG: ${{ steps.meta.outputs.tags[0] }}
4038
- name: Archive artifacts
4139
uses: actions/upload-artifact@v4
4240
with:

ci/build-in-docker.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ cwd="$PWD"
3232
repo_root="$(readlink -f "$(dirname "$0")"/..)"
3333

3434
# use docker image tag provided by GitHub actions if possible
35-
DOCKER_TAG="${DOCKER_TAG:-ghcr.io/appimage/appimageupdate-build:local-build}"
35+
docker_tag="ghcr.io/appimagecommunity/appimageupdate-build:$(cut -d: -f2- <<<"${DOCKER_METADATA_OUTPUT_TAGS:-:local-build}")"
3636

37-
default_branch_tag="$(echo "$DOCKER_TAG" | cut -d: -f1):$(echo "${GITHUB_DEFAULT_BRANCH:-main}" | rev | cut -d/ -f1 | rev)"
37+
default_branch_tag="$(cut -d: -f1 <<<"$docker_tag"):$(echo "${GITHUB_DEFAULT_BRANCH:-main}" | rev | cut -d/ -f1 | rev)"
3838

3939
extra_build_args=()
4040

4141
if [[ "${GITHUB_ACTIONS:-}" != "" ]]; then
4242
echo "Building on GitHub actions, pushing cache"
4343
extra_build_args+=(
44-
--output "type=registry,ref=${DOCKER_TAG}"
44+
--output "type=registry,ref=${docker_tag}"
4545
--push
4646
)
4747
else
@@ -51,10 +51,10 @@ fi
5151
# building local image to "cache" installed dependencies for subsequent builds
5252
docker buildx build \
5353
"${extra_build_args[@]}" \
54-
--cache-from "type=registry,ref=${DOCKER_TAG}" \
54+
--cache-from "type=registry,ref=${docker_tag}" \
5555
--cache-from "type=registry,ref=${default_branch_tag}" \
5656
--platform "$docker_platform" \
57-
-t "$DOCKER_TAG" \
57+
-t "$docker_tag" \
5858
--build-arg ARCH="$ARCH" \
5959
--build-arg CMAKE_ARCH="$CMAKE_ARCH" \
6060
"$repo_root"/ci
@@ -80,5 +80,5 @@ docker run \
8080
-v "$cwd":/out \
8181
-w /out \
8282
--user "$uid" \
83-
"$DOCKER_TAG" \
83+
"$docker_tag" \
8484
bash /ws/ci/build-appimages.sh

0 commit comments

Comments
 (0)