@@ -12,25 +12,26 @@ permissions:
1212jobs :
1313 build :
1414 runs-on : ubuntu-latest
15+ timeout-minutes : 60
16+ container :
17+ image : moby/buildkit:latest
18+ options : --privileged
1519 steps :
1620 # checkout code:
1721 - uses : actions/checkout@v4
18- # create json file with credentials for github container registry:
19- - uses : docker/login-action@v3
20- with :
21- registry : ghcr.io
22- username : ${{ github.actor }}
23- password : ${{ secrets.GITHUB_TOKEN }}
24- # ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`)
25- # to lowercase which is needed for using as image name
26- - name : downcase GITHUB_REPOSITORY
22+ name : checkout code
23+ # build image:
24+ - name : build container
2725 run : |
28- echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
29- # build container image with kaniko:
30- - uses : int128/kaniko-action@v1
31- with :
32- file : container/Dockerfile
33- push : true
34- tags : ghcr.io/${{ env.REPO }}:${{ github.ref_name }}
35- labels : GITREF=${{ github.sha }}
36- build-args : GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
26+ # registry credentials
27+ export DOCKER_CONFIG="$(pwd)/container"
28+ echo "{\"auths\":{\"ghcr.io\":{\"auth\":\"$(echo -n ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} | base64)\"}}}" > $DOCKER_CONFIG/config.json
29+ # ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`)
30+ REPO="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')"
31+ # build
32+ buildctl-daemonless.sh build \
33+ --progress plain \
34+ --frontend=dockerfile.v0 \
35+ --local context=. \
36+ --local dockerfile=container \
37+ --output type=image,"\"name=ghcr.io/${REPO}:${{ github.ref_name }}\",push=true"
0 commit comments