no message #24
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 to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| prepare-plugin-data: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Download latest plugin data | |
| run: | | |
| echo "Downloading plugin data from latest release..." | |
| curl -L -o plugins-data.zip \ | |
| https://github.com/litestar-org/plugins/releases/latest/download/plugins-and-readmes.zip | |
| echo "Extracting plugin data..." | |
| unzip -o plugins-data.zip | |
| echo "Moving files to content directories..." | |
| # Remove existing plugin files to ensure clean state | |
| rm -rf content/plugins/*.yml content/readme/*.md | |
| # Move extracted files to content directories | |
| mv plugins/*.yml content/plugins/ | |
| mv readmes/*.md content/readme/ | |
| # Clean up | |
| rm -rf plugins readmes plugins-data.zip | |
| echo "Plugin data updated successfully" | |
| echo "Plugin count: $(ls -1 content/plugins/*.yml 2>/dev/null | wc -l)" | |
| echo "README count: $(ls -1 content/readme/*.md 2>/dev/null | wc -l)" | |
| - name: Commit and push plugin data | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add content/plugins/*.yml content/readme/*.md | |
| # Only commit if there are changes | |
| if git diff --staged --quiet; then | |
| echo "No changes to plugin data" | |
| else | |
| git commit -m "chore: update plugin data from latest release [skip ci]" | |
| git push | |
| echo "Plugin data committed and pushed to main" | |
| fi | |
| - name: Upload workspace | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: workspace-with-plugins | |
| path: . | |
| build: | |
| needs: prepare-plugin-data | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download workspace | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: workspace-with-plugins | |
| path: . | |
| - run: corepack enable | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| # Pick your own package manager and build script | |
| - run: pnpm install --frozen-lockfile | |
| - name: Update stats | |
| run: pnpm run update-stats | |
| - run: pnpm nuxt generate --preset github_pages | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./.output/public | |
| # Deployment job | |
| deploy: | |
| # Add a dependency to the build job | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |