feat(pollinations): add configuration options method #1
This file contains hidden or 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: Deploy docs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/**' | |
| - 'lib/tasks/models_docs.rake' | |
| - '.github/workflows/docs.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Ruby for models guide generation (root Gemfile) | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| - name: Run models:docs rake task | |
| run: bundle exec rake models:docs | |
| - name: Install OG image system dependencies (only if missing) | |
| run: | | |
| packages=() | |
| if command -v vips >/dev/null 2>&1; then | |
| echo "libvips already available: $(vips --version)" | |
| else | |
| packages+=(libvips) | |
| fi | |
| if fc-list | grep -qi inter; then | |
| echo "Inter fonts already available" | |
| else | |
| packages+=(fonts-inter fonts-inter-variable) | |
| fi | |
| if [ ${#packages[@]} -gt 0 ]; then | |
| echo "Installing apt packages: ${packages[*]}" | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends "${packages[@]}" | |
| else | |
| echo "No apt packages needed" | |
| fi | |
| - name: Cache fonts | |
| uses: actions/cache@v5 | |
| id: cache-fonts | |
| with: | |
| path: | | |
| /usr/share/fonts/truetype/plus-jakarta-sans | |
| ~/.cache/fontconfig | |
| key: ${{ runner.os }}-fonts-v2 | |
| restore-keys: | | |
| ${{ runner.os }}-fonts- | |
| - name: Install Plus Jakarta Sans for OG image generation | |
| run: | | |
| if [ "${{ steps.cache-fonts.outputs.cache-hit }}" != "true" ]; then | |
| echo "Installing Plus Jakarta Sans..." | |
| wget -q https://github.com/tokotype/PlusJakartaSans/archive/refs/heads/master.zip -O PlusJakartaSans.zip | |
| unzip -q PlusJakartaSans.zip | |
| sudo mkdir -p /usr/share/fonts/truetype/plus-jakarta-sans | |
| sudo cp PlusJakartaSans-master/fonts/ttf/*.ttf /usr/share/fonts/truetype/plus-jakarta-sans/ | |
| rm -rf PlusJakartaSans.zip PlusJakartaSans-master | |
| else | |
| echo "Plus Jakarta Sans cached" | |
| fi | |
| # Always update font cache | |
| sudo fc-cache -fv | |
| # Verify fonts are installed | |
| echo "Verifying fonts:" | |
| fc-list | grep -i inter || echo "Inter font not found" | |
| fc-list | grep -i jakarta || echo "Plus Jakarta Sans not found" | |
| - name: Setup Ruby for Jekyll build (docs Gemfile) | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' | |
| bundler-cache: true | |
| working-directory: docs | |
| cache-version: 3 | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v5 | |
| - name: Build with Jekyll | |
| working-directory: docs | |
| run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/_site | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |