Publish Episodes to ATProto #25
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: Publish Episodes to ATProto | |
| on: | |
| # Run after the daily site rebuild to catch new episodes | |
| workflow_run: | |
| workflows: ["Rebuild Astro Site"] | |
| types: [completed] | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| jobs: | |
| # Skip publishing entirely if standard.site/ATProto secrets aren't configured, | |
| # so forks without standard.site set up don't fail this workflow. | |
| check: | |
| runs-on: ubuntu-latest | |
| # Only run if the triggering workflow succeeded (or manual dispatch) | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| outputs: | |
| configured: ${{ steps.config.outputs.configured }} | |
| steps: | |
| - name: Check ATProto configuration | |
| id: config | |
| env: | |
| ATPROTO_HANDLE: ${{ secrets.ATPROTO_HANDLE }} | |
| ATPROTO_APP_PASSWORD: ${{ secrets.ATPROTO_APP_PASSWORD }} | |
| STANDARD_SITE_URL: ${{ secrets.STANDARD_SITE_URL }} | |
| STANDARD_SITE_PUBLICATION_RKEY: ${{ secrets.STANDARD_SITE_PUBLICATION_RKEY }} | |
| run: | | |
| if [ -n "$ATPROTO_HANDLE" ] && [ -n "$ATPROTO_APP_PASSWORD" ] && [ -n "$STANDARD_SITE_URL" ] && [ -n "$STANDARD_SITE_PUBLICATION_RKEY" ]; then | |
| echo "configured=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "configured=false" >> "$GITHUB_OUTPUT" | |
| echo "::notice::standard.site/ATProto secrets not set — skipping episode publishing." | |
| fi | |
| publish: | |
| needs: check | |
| if: ${{ needs.check.outputs.configured == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: pnpm/action-setup@v4 | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - uses: actions/cache@v4 | |
| name: Setup pnpm cache | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Publish new episodes | |
| run: pnpm tsx scripts/publish-episodes.ts | |
| env: | |
| ATPROTO_HANDLE: ${{ secrets.ATPROTO_HANDLE }} | |
| ATPROTO_APP_PASSWORD: ${{ secrets.ATPROTO_APP_PASSWORD }} | |
| STANDARD_SITE_URL: ${{ secrets.STANDARD_SITE_URL }} | |
| STANDARD_SITE_PUBLICATION_RKEY: ${{ secrets.STANDARD_SITE_PUBLICATION_RKEY }} |