genai alt text generator #4
This file contains 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: genai alt text generator | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 4 * * *" | |
pull_request: | |
paths: | |
- "docs/src/**/*.png" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
fetch-depth: 10 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: yarn | |
- run: yarn install --frozen-lockfile | |
- name: compile | |
run: yarn compile | |
- name: alt text | |
run: yarn genai:alt | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
OPENAI_API_TYPE: ${{ secrets.OPENAI_API_TYPE }} | |
OPENAI_API_BASE: ${{ secrets.OPENAI_API_BASE }} | |
- name: install sharp | |
run: cd docs && yarn add [email protected] | |
- name: docs | |
run: yarn build:docs | |
- name: gif diff | |
run: git diff --name-only | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: "docs/src/**/*.txt" | |
commit_message: "[genai] alt text update" | |
commit_user_name: "genaiscript" |