Skip to content

Generate Theme Previews #5

Generate Theme Previews

Generate Theme Previews #5

Workflow file for this run

name: Generate Theme Previews
permissions:
contents: write
packages: write
on:
workflow_dispatch:
push:
branches: [ main ]
paths: [ 'twilite.json', 'twilite-darker.json' ]
pull_request:
branches: [ main ]
paths: [ 'twilite.json', 'twilite-darker.json' ]
jobs:
generate:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,defaults
environment-file: environment.yml
activate-environment: twilite-theme
python-version: 3.11
use-mamba: false
# Debug steps are to show conda env
- name: Conda debugging
if: runner.debug == '1'
run: |
conda env export
conda env list
- name: Generate PNG previews
shell: bash -el {0}
run: python ./scripts/generate_previews.py
- name: Git config
run: |
git config --local user.email 'action@github.com'
git config --local user.name 'GitHub Action'
- name: Commit previews
run: |
git add assets/img/
git status --porcelain assets/img/ | grep -q . || exit 0
git diff --staged --quiet || git commit -m 'chore(preview): regenerate theme preview ♡'
git push