Skip to content
Draft
Show file tree
Hide file tree
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
56 changes: 56 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Deploy Pages

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "registry/**"
- "src/**"
- "public/**"
- "index.html"
- "package.json"
- "pnpm-lock.yaml"
- "vite.config.ts"
- ".github/workflows/pages.yml"

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile
- run: pnpm build
- run: cp -R registry dist/registry

- uses: actions/configure-pages@v5
with:
enablement: true
- uses: actions/upload-pages-artifact@v4
with:
path: dist
- id: deployment
uses: actions/deploy-pages@v4
37 changes: 37 additions & 0 deletions .github/workflows/sync-discord-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Sync Discord store

on:
workflow_dispatch:
schedule:
- cron: "*/30 * * * *"

permissions:
contents: write

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm

- run: pnpm install --frozen-lockfile

- run: pnpm sync:discord-store
env:
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Commit registry update
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "chore: sync Discord store registry"
file_pattern: registry/store.json registry/store.yml
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
"serve": "vite preview",
"sync:discord-store": "node scripts/sync-discord-store.mjs"
},
"license": "MIT",
"devDependencies": {
Expand Down
Loading