diff --git a/.github/workflows/cheatsheet.yml b/.github/workflows/cheatsheet.yml new file mode 100644 index 0000000..9a7795c --- /dev/null +++ b/.github/workflows/cheatsheet.yml @@ -0,0 +1,26 @@ +name: cheatsheet + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: write + +jobs: + cheatsheet: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: build docker image and generate cheatsheets + run: | + docker compose build + docker compose up + + - name: commit cheatsheets + run: | + git config --global user.email "github-actions@github.com" + git config --global user.name "GitHub Actions" + git add cheatsheets + git commit -m "update cheatsheet" + git push diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..03cab60 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM alpine:latest + +# install dependencies (curl, sudo, bash) +RUN apk --no-cache add curl sudo bash + +# install zmk-viewer +RUN curl -sL https://raw.githubusercontent.com/MrMarble/zmk-viewer/master/scripts/install.sh | sudo -E bash - + +WORKDIR /images diff --git a/cheatsheets/cradio.png b/cheatsheets/cradio.png new file mode 100644 index 0000000..5def9c3 Binary files /dev/null and b/cheatsheets/cradio.png differ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d0ef80b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + cheatsheet-generator: + build: + context: . + dockerfile: Dockerfile + volumes: + - ./config:/config + - ./cheatsheets:/images + command: sh -c "rm /images/*; + zmk-viewer generate cradio -f /config/*.keymap --single;"