Skip to content
Merged
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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

permissions:
contents: read

on:
push:
branches:
- main
pull_request:

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2

- name: Setup Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: v2.x
cache: true

- name: Check formatter, linter, and types
run: deno task check
39 changes: 27 additions & 12 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@ name: Update APIs
permissions:
contents: write
pages: write
id-token: write

on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

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

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

- name: Setup Deno
uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v2.0.4
with:
deno-version: v1.x
deno-version: v2.x
cache: true

- name: Run fetcher script
run: deno run --allow-net --allow-read --allow-write fetcher.ts
run: deno task update

- name: Format README.md
run: deno fmt README.md
Expand All @@ -32,12 +41,18 @@ jobs:
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m ":card_file_box: Update APIs: $(date +'%Y-%m-%d')" || exit 0
git push

- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if git diff --cached --quiet; then
echo "No API changes to commit"
else
git commit -m ":card_file_box: Update APIs: $(date +'%Y-%m-%d')"
git push
fi

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
force_orphan: true
path: ./

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5.0.0
10 changes: 10 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tasks": {
"update": "deno run --allow-net --allow-read --allow-write fetcher.ts",
"check": "deno fmt --check fetcher.ts .github && deno lint fetcher.ts && deno check fetcher.ts"
},
"imports": {
"@std/fs/ensure-dir": "jsr:@std/fs@1.0.23/ensure-dir",
"slugify": "https://deno.land/x/slugify@0.3.0/mod.ts"
}
}
19 changes: 19 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading