Skip to content

Update nostr.json from Firestore #241

Update nostr.json from Firestore

Update nostr.json from Firestore #241

name: Update nostr.json from Firestore
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
generate-and-commit:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Generate nostr.json
env:
GITHUB_ACTIONS_KEY: ${{ secrets.ACTIONS_KEY }}
run: node scripts/generate-nostr-json.js
- name: Commit changes
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add .well-known/nostr.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update nostr.json from Firestore"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}