chore: update data #177
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Container Build" | |
| on: | |
| workflow_dispatch: # needed for manually running this workflow | |
| schedule: | |
| - cron: "15 3 * * *" # sadly there is no TZ support here | |
| push: | |
| branches: | |
| - "main" | |
| - "develop" | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| container: | |
| image: moby/buildkit:latest | |
| options: --privileged | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Build container | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| # ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`) | |
| REPO="$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]')" | |
| # regular build | |
| PARAMS="--output type=image,\"name=ghcr.io/${REPO}:${{ github.ref_name }}\",push=true" | |
| else | |
| # only build with small wiki list and no image push | |
| PARAMS="--output type=image,push=false --opt build-arg:WIKI_FILE=website/test/3rd-Party-Modules.md" | |
| fi | |
| # registry credentials | |
| export DOCKER_CONFIG="$(pwd)/container" | |
| echo "{\"auths\":{\"ghcr.io\":{\"auth\":\"$(echo -n ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} | base64 -w 0)\"}}}" > $DOCKER_CONFIG/config.json | |
| # build | |
| buildctl-daemonless.sh build \ | |
| --progress plain \ | |
| --frontend=dockerfile.v0 \ | |
| --local context=. \ | |
| --local dockerfile=container \ | |
| --opt build-arg:GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | |
| $PARAMS |