forked from shipshapecode/starpod
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 2.39 KB
/
Copy pathbackfill-episodes.yml
File metadata and controls
65 lines (62 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Backfill Episodes to ATProto
on:
workflow_dispatch:
inputs:
confirm:
description: 'Type "backfill" to confirm publishing all episodes to ATProto'
required: true
type: string
jobs:
# Skip backfill 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
if: ${{ github.event.inputs.confirm == 'backfill' }}
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 backfill."
fi
backfill:
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: Backfill all episodes
run: pnpm tsx scripts/publish-episodes.ts --backfill
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 }}