Compare commits
No commits in common. "output" and "main" have entirely different histories.
44
.gitea/workflows/snake.yml
Normal file
44
.gitea/workflows/snake.yml
Normal file
@ -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 (OKF/guides/12).
|
||||||
|
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/<name>/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
|
||||||
4
README.md
Normal file
4
README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://git.lukaszboryn.dev/lukabor/.profile/raw/branch/output/snake-dark.svg">
|
||||||
|
<img alt="Contribution heatmap eaten by a snake" src="https://git.lukaszboryn.dev/lukabor/.profile/raw/branch/output/snake.svg">
|
||||||
|
</picture>
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 22 KiB |
Loading…
x
Reference in New Issue
Block a user