commit 5947717b7cbe8480dd701e822fee085e4d5720b4 Author: Lukasz Boryn Date: Fri Oct 16 13:34:53 2026 +0200 feat: snake on the profile page diff --git a/.gitea/workflows/snake.yml b/.gitea/workflows/snake.yml new file mode 100644 index 0000000..be8f978 --- /dev/null +++ b/.gitea/workflows/snake.yml @@ -0,0 +1,44 @@ +# Draws the contribution heatmap as a snake game and publishes the SVGs to +# the orphan `output` branch, which README.md embeds. Runs on the mithlond +# runner (docs/11). +name: snake + +on: + schedule: + # Daily, clear of the 03:30 backup window when Gitea is stopped. + - cron: "0 5 * * *" + workflow_dispatch: + push: + branches: [main] + +defaults: + run: + shell: sh + +jobs: + generate: + runs-on: alpine + steps: + - name: Generate SVGs from the Gitea heatmap + run: | + host=${GITHUB_SERVER_URL#https://}; host=${host%/} + # Gitea serves the same /api/v1/users//heatmap as Forgejo. + npx --yes generate-snake-animation@3.5.0 \ + --forgejo_user="$host/$GITHUB_REPOSITORY_OWNER" \ + --output=dist/snake.svg \ + --output='dist/snake-dark.svg?palette=github-dark' + + - name: Publish to the output branch + env: + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + apk add --no-cache -q git + host=${GITHUB_SERVER_URL#https://}; host=${host%/} + cd dist + git init -q -b output + git config user.name "snake" + git config user.email "actions@$host" + git add . + git commit -qm "Update snake" + # Single orphan commit, force-pushed: old SVGs do not pile up. + git push -qf "https://x-access-token:$TOKEN@$host/$GITHUB_REPOSITORY.git" output diff --git a/README.md b/README.md new file mode 100644 index 0000000..33575e8 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ + + + Contribution heatmap eaten by a snake +