Skip to content

Commit

Permalink
BREAKING CHANGE: rebuilding with 2024 stack (#335)
Browse files Browse the repository at this point in the history
* BREAKING CHANGE: notion-based content repository in app router

* feat: add markdown rendering

* chore: update eslint config

* feat: og image for posts

* feat: bookmarks

* chore: storybook

* BRAKING CHANGE: implement major functionalities

* feat: add hash-based authz at /images endpoint

* fix: modify storybook config

* feat: modify image endpoint

* chore: set up github actions for pull requests

* chore: install sentry

* fix: drop a partially-supported css value

* feat: add sitemap and robots.txt

* feat: add icons

* feat: add metadata

* feat: i18n

* feat: configure csp

* feat: add global error handler

* feat: update icon

* feat: better handling of assets in image generation

* feat: 404 page
  • Loading branch information
Kohei committed Feb 18, 2024
1 parent 99fbe6e commit 8b3314d
Show file tree
Hide file tree
Showing 323 changed files with 23,722 additions and 49,475 deletions.
11 changes: 0 additions & 11 deletions .babelrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
last 1 iOS major versions, last 3 ChromeAndroid versions, last 3 Chrome versions, last 1 Safari major versions, last 3 Edge versions, last 2 Firefox versions, not dead
5 changes: 5 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NOTION_INTEGRATION_SECRET=
NOTION_BIO_DATABASE_ID=
NOTION_POST_DATABASE_ID=
GOOGLE_ANALYTICS_MEASUREMENT_ID=
IMAGE_SECRET=
40 changes: 40 additions & 0 deletions .github/actions/vercel-deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Vercel Deploy
description: Deploy the prebuilt application to Vercel.
inputs:
vercel-org-id:
description: The organization id at Vercel
required: true
vercel-project-id:
description: The project id at Vercel
required: true
vercel-token:
description: The auth token for Vercel
required: true
outputs:
url:
description: The preview deployment URL
value: ${{ steps.deployment.outputs.url }}
runs:
using: "composite"
steps:
- name: Create a Placeholder for project.json
run: |
mkdir .vercel
jq -n -c '.projectId="${{ inputs.vercel-project-id }}"|.orgId|="${{ inputs.vercel-org-id }}"' \
> .vercel/project.json
shell: bash
- name: Restore the Build from Artifacts
uses: actions/download-artifact@v4
with:
name: vercel-build-${{ github.sha }}
path: ./
- name: Vercel Deploy
id: deployment
run: |
npx vercel deploy \
--prebuilt \
--token ${{ inputs.vercel-token }} \
--skip-domain \
> ${{runner.temp}}/url.txt
echo "url=$(cat ${{runner.temp}}/url.txt)" >> $GITHUB_OUTPUT
shell: bash
62 changes: 62 additions & 0 deletions .github/actions/vercel-prebuild/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Vercel Prebuild
description: Prebuild the project with Vercel CLI
inputs:
vercel-org-id:
description: The organization id at Vercel
required: true
vercel-project-id:
description: The project id at Vercel
required: true
vercel-token:
description: The auth token for Vercel
required: true
build-command:
description: The shell command to build the application
default: npm run build
branch:
description: The Git branch. Keep empty for production deployments
runs:
using: "composite"
steps:
- name: Create a Placeholder for project.json
run: |
mkdir .vercel
jq -n -c '.projectId="${{ inputs.vercel-project-id }}"|.orgId|="${{ inputs.vercel-org-id }}"' \
> .vercel/project.json
shell: bash
- name: Pull the Vercel Project (Production)
if: ${{ inputs.branch == null }}
run: |
npx vercel pull \
--token=${{ inputs.vercel-token }} \
--environment=production
shell: bash
- name: Pull the Vercel Project (Preview)
if: ${{ inputs.branch != null }}
run: |
npx vercel pull \
--token=${{ inputs.vercel-token }} \
--environment=preview \
--git-branch=${{ inputs.branch }}
shell: bash
- name: Update the Build Command
run: |
cp .vercel/project.json ${{ runner.temp }}/vercel-project.json
cat ${{ runner.temp }}/vercel-project.json \
| jq -c '.settings.buildCommand="${{ inputs.build-command }}"' \
> .vercel/project.json
shell: bash
- name: Check project.json
run: cat .vercel/project.json
shell: bash
- name: Build
run: npx vercel build --token=${{ inputs.vercel-token }}
shell: bash
- name: Store the Build as Artifacts
uses: actions/upload-artifact@v4
with:
name: vercel-build-${{ github.sha }}
path: |
.vercel/output
.next
if-no-files-found: error
102 changes: 0 additions & 102 deletions .github/workflows/before-merge.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Code Format Check
on:
- pull_request
jobs:
prettier:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install Dependencies
run: npm ci
- name: Run Prettier Check
run: npx prettier --check .
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install Dependencies
run: npm ci
- name: Run ESLint
run: npx eslint .
69 changes: 69 additions & 0 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Preview Deploy
on:
- pull_request
permissions:
issues: write
pull-requests: write
jobs:
prebuild:
name: Prebuild
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install Dependencies
run: npm ci
- name: Vercel Prebuild
uses: ./.github/actions/vercel-prebuild
with:
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
branch: ${{ github.ref_name }}
build-command: npx next build
deploy:
name: Deploy
needs:
- prebuild
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install Dependencies
run: npm ci
- name: Vercel Deploy
id: deployment
uses: ./.github/actions/vercel-deploy
with:
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
- name: Test
run: cat ${{ steps.deployment.outputs.url }}
- name: Find the Previous Comment
uses: peter-evans/find-comment@v3
id: previous-comment
with:
issue-number: ${{ github.event.number }}
comment-author: "github-actions[bot]"
body-includes: <!-- deployment \#${{ github.event.number }} -->
direction: last
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
comment-id: ${{ steps.previous-comment.outputs.comment-id }}
edit-mode: replace
body: |
<!-- deployment \#${{ github.event.number }} -->
🚀 Deployed a preview:
${{ steps.deployment.outputs.url }}
Loading

0 comments on commit 8b3314d

Please sign in to comment.