Build Sitemap #4
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: Build Sitemap | |
| on: | |
| schedule: | |
| # Run on the 1st day of every month at 2:00 AM UTC | |
| - cron: "0 2 1 * *" | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| build-sitemap: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up permissions | |
| run: | | |
| chmod +x ./build-sitemap.sh | |
| - name: Run sitemap build script | |
| run: | | |
| ./build-sitemap.sh | |
| - name: Check if sitemap files were generated | |
| run: | | |
| if [ ! -d "sitemap" ]; then | |
| echo "Error: sitemap directory was not created" | |
| exit 1 | |
| fi | |
| if [ ! -f "sitemap/index.xml" ]; then | |
| echo "Error: index.xml was not generated" | |
| exit 1 | |
| fi | |
| echo "Sitemap files generated successfully:" | |
| ls -la sitemap/ | |
| - name: Upload build log | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: build-sitemap-log | |
| path: build-sitemap.log | |
| retention-days: 5 | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "Update sitemap files - ${{ steps.date.outputs.date }}" | |
| title: "Update sitemap files - ${{ steps.date.outputs.date }}" | |
| body: | | |
| This PR contains updated sitemap files generated by the automated build process. | |
| **Changes:** | |
| - Updated sitemap files for all providers (Farcaster, Lens, Twitter) | |
| - Updated main sitemap index | |
| - Updated build log | |
| **Generated on:** ${{ steps.date.outputs.date }} | |
| branch: update-sitemap-${{ steps.date.outputs.date }} | |
| delete-branch: true | |
| labels: | | |
| automated | |
| sitemap |