Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/update_community_projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Update community projects

on:
schedule:
- cron: "17 2 * * *"
workflow_dispatch:

permissions:
contents: write
pages: write

concurrency:
group: update-community-projects
cancel-in-progress: false

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout default branch
uses: actions/checkout@v7
with:
ref: ${{ github.event.repository.default_branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Install JSON Schema validator
run: python -m pip install check-jsonschema==0.37.4

- name: Validate community projects data
run: check-jsonschema --schemafile data/community-projects.schema.json data/community-projects.json

- name: Run linter
run: bun run lint

- name: Update community projects
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run gen-community-projects

- name: Stage and check for changes
id: changes
run: |
git add data/community-projects.json docs/examples/community docs/examples/overview.mdx
if git diff --cached --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Build project
if: steps.changes.outputs.changed == 'true'
run: bun run build

- name: Commit and push changes
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "chore: update community project stars"
git push origin "HEAD:${{ github.event.repository.default_branch }}"

- name: Deploy to GitHub Pages
if: steps.changes.outputs.changed == 'true'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
cname: developers.anytype.io