49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
name: Update dist.css
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- ".github/workflows/generate-db.yml"
|
|
- ".github/scripts/generate/**/*.*"
|
|
- "db/template.css"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
generate:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18.x
|
|
|
|
- name: Setup PNPM
|
|
working-directory: .github/scripts
|
|
run: |
|
|
npm i -g pnpm
|
|
pnpm i
|
|
|
|
- name: Generate CSS
|
|
id: generate-css
|
|
run: |
|
|
# Use a script or command to generate the CSS content based on your requirements.
|
|
# For example, you can create the CSS content using echo:
|
|
echo "[style^=\"https://cdn.discordapp.com/avatars/559426966151757824\"],[src^=\"https://cdn.discordapp.com/avatars/559426966151757824\"] { /* Your CSS styles here */ }" > db/dist.css
|
|
|
|
- name: Push changes
|
|
continue-on-error: ${{ success() }}
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
# Use the generated CSS content from the previous step to update the dist.css file.
|
|
git add db/dist.css
|
|
git commit -m "chore(db): update dist.css (${{ github.sha || 'manual trigger' }})" || true
|
|
git push
|