Skip to content

Container Build

Container Build #2

name: "Container Build"
on:
workflow_dispatch: # needed for manually running this workflow
schedule:
- cron: "30 5 * * *" # sadly there is no TZ support here
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
# checkout code:
- uses: actions/checkout@v3
# create json file with credentials for github container registry:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# ugly workaround for converting content of $GITHUB_REPOSITORY (= `MagicMirrorOrg/MagicMirror-3rd-Party-Modules`)
# to lowercase which is needed for using as image name
- name: downcase GITHUB_REPOSITORY
run: |
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}"
# build container image with kaniko:
- uses: int128/kaniko-action@v1
with:
file: container/Dockerfile
push: true
tags: ghcr.io/${{ env.REPO }}:${{ github.ref_name }}
labels: GITREF=${{ github.sha }}
build-args: GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}