A CLI for publishing standard.site documents to ATProto
at main 81 lines 2.3 kB view raw
1name: 'Sequoia Publish' 2description: 'Publish your markdown content to ATProtocol using Sequoia CLI' 3branding: 4 icon: 'upload-cloud' 5 color: 'green' 6 7inputs: 8 identifier: 9 description: 'ATProto handle or DID (e.g. yourname.bsky.social)' 10 required: true 11 app-password: 12 description: 'ATProto app password' 13 required: true 14 pds-url: 15 description: 'PDS URL (defaults to https://bsky.social)' 16 required: false 17 default: 'https://bsky.social' 18 force: 19 description: 'Force publish all posts, ignoring change detection' 20 required: false 21 default: 'false' 22 commit-back: 23 description: 'Commit updated frontmatter and state file back to the repo' 24 required: false 25 default: 'true' 26 working-directory: 27 description: 'Directory containing sequoia.json (defaults to repo root)' 28 required: false 29 default: '.' 30 31runs: 32 using: 'composite' 33 steps: 34 - name: Setup Bun 35 uses: oven-sh/setup-bun@v2 36 37 - name: Build and install Sequoia CLI 38 shell: bash 39 run: | 40 cd ${{ github.action_path }} 41 bun install 42 bun run build:cli 43 bun link --cwd packages/cli 44 45 - name: Sync state from ATProtocol 46 shell: bash 47 working-directory: ${{ inputs.working-directory }} 48 env: 49 ATP_IDENTIFIER: ${{ inputs.identifier }} 50 ATP_APP_PASSWORD: ${{ inputs.app-password }} 51 PDS_URL: ${{ inputs.pds-url }} 52 run: sequoia sync 53 54 - name: Publish 55 shell: bash 56 working-directory: ${{ inputs.working-directory }} 57 env: 58 ATP_IDENTIFIER: ${{ inputs.identifier }} 59 ATP_APP_PASSWORD: ${{ inputs.app-password }} 60 PDS_URL: ${{ inputs.pds-url }} 61 run: | 62 FLAGS="" 63 if [ "${{ inputs.force }}" = "true" ]; then 64 FLAGS="--force" 65 fi 66 sequoia publish $FLAGS 67 68 - name: Commit back changes 69 if: inputs.commit-back == 'true' 70 shell: bash 71 working-directory: ${{ inputs.working-directory }} 72 run: | 73 git config user.name "$(git log -1 --format='%an')" 74 git config user.email "$(git log -1 --format='%ae')" 75 git add -A *.md **/*.md || true 76 if git diff --cached --quiet; then 77 echo "No changes to commit" 78 else 79 git commit -m "chore: update sequoia state [skip ci]" 80 git push 81 fi