Skip to content

Commit b6e94f9

Browse files
fix: full run also on schedule
1 parent 97c235a commit b6e94f9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/container-build.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@ jobs:
2525
uses: actions/checkout@v5
2626
- name: Build container
2727
run: |
28-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
29-
# ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`)
30-
REPO="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')"
31-
# regular build
32-
PARAMS="--output type=image,\"name=ghcr.io/${REPO}:${{ github.ref_name }}\",push=true"
33-
else
34-
# only build with small wiki list and no image push
35-
PARAMS="--output type=image,push=false --opt build-arg:WIKI_FILE=website/test/3rd-Party-Modules.md"
36-
fi
28+
RUN_KIND="${{ github.event_name }}"
29+
case "$RUN_KIND" in
30+
workflow_dispatch|schedule)
31+
# full run (manual trigger or cron) – build and push the image with ref-specific tag
32+
REPO="$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]')"
33+
PARAMS="--output type=image,\"name=ghcr.io/${REPO}:${{ github.ref_name }}\",push=true"
34+
;;
35+
*)
36+
# lightweight fallback (e.g. push event) – skip image push and use reduced wiki dataset
37+
PARAMS="--output type=image,push=false --opt build-arg:WIKI_FILE=website/test/3rd-Party-Modules.md"
38+
;;
39+
esac
3740
# registry credentials
3841
export DOCKER_CONFIG="$(pwd)/container"
3942
echo "{\"auths\":{\"ghcr.io\":{\"auth\":\"$(echo -n ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} | base64 -w 0)\"}}}" > $DOCKER_CONFIG/config.json

0 commit comments

Comments
 (0)