shows-feed #73
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: shows-feed | |
| on: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| jobs: | |
| crawl: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| source: | |
| # Tech job boards | |
| - { | |
| name: "Bandsintown", | |
| url: "https://www.bandsintown.com/all-dates/genre/all-genres", | |
| selector: 'a[href*="/e/"]', | |
| } | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies with retry | |
| run: | | |
| for i in {1..3}; do | |
| if bun install; then | |
| echo "✅ Dependencies installed successfully" | |
| break | |
| else | |
| echo "❌ Install failed, attempt $i/3" | |
| sleep 30 | |
| if [ $i -eq 3 ]; then | |
| echo "💥 All install attempts failed" | |
| exit 1 | |
| fi | |
| fi | |
| done | |
| - run: mkdir -p results | |
| - name: Crawl shows | |
| run: bun src/crawler.ts | |
| env: | |
| SOURCE_NAME: ${{ matrix.source.name }} | |
| SOURCE_URL: ${{ matrix.source.url }} | |
| SELECTOR: ${{ matrix.source.selector }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| continue-on-error: true | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.source.name }} | |
| path: results/${{ matrix.source.name }}.json | |
| if-no-files-found: ignore | |
| build: | |
| needs: crawl | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies with retry | |
| run: | | |
| for i in {1..3}; do | |
| if bun install; then | |
| echo "✅ Dependencies installed successfully" | |
| break | |
| else | |
| echo "❌ Install failed, attempt $i/3" | |
| sleep 30 | |
| if [ $i -eq 3 ]; then | |
| echo "💥 All install attempts failed" | |
| exit 1 | |
| fi | |
| fi | |
| done | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: results | |
| - run: find results -name "*.json" -exec mv {} results/ \; | |
| - run: bun src/buildFeed.ts | |
| - uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs | |
| enable_jekyll: false |