Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from albelium/rt/migrate-docs-to-starlight
Browse files Browse the repository at this point in the history
🎉 ドキュメントアプリを Starlight に変更
  • Loading branch information
tatsutakein authored Jan 9, 2024
2 parents e80fa59 + d942317 commit a03717f
Show file tree
Hide file tree
Showing 48 changed files with 2,369 additions and 5,597 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Team 名で指定。 すべてのファイルに web-application-template-maintainers チームの全員が権限を持つ
* @albelium/web-application-template-maintainers
* @albelium/web-application-template-maintainers @albelium-bot[bot]

# GitHub や Tools 関連は @tatsutakein がオーナとなる
/.github/ @tatsutakein
/.github/ @tatsutakein @albelium-bot[bot]
/scripts/ @tatsutakein
/tools/ @tatsutakein
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ updates:
patterns:
- "turbo"
- "@turbo/*"
astro:
patterns:
- "astro"
- "@astrojs/*"

- package-ecosystem: 'github-actions'
directory: '/'
Expand Down
111 changes: 23 additions & 88 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ on:
branches:
- main

concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true

jobs:
filter:
changed:
runs-on: ubuntu-22.04
outputs:
check-frontend: ${{ steps.needs.outputs.check-frontend }}
check-backend: ${{ steps.needs.outputs.check-backend }}
check-docs: ${{ steps.needs.outputs.check-docs }}
frontend: ${{ steps.needs.outputs.frontend }}
backend: ${{ steps.needs.outputs.backend }}
docs: ${{ steps.needs.outputs.docs }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -21,104 +25,35 @@ jobs:
id: changes
with:
filters: |
check-frontend:
frontend:
- 'apps/frontend/**/*'
- 'packages/eslint-config-custom/**/*'
- 'packages/icon/**/*'
- 'packages/panda-preset/**/*'
- 'packages/tsconfig/**/*'
- 'packages/ui/**/*'
- 'package.json'
check-backend:
backend:
- 'apps/backend/**/*'
- 'packages/eslint-config-custom/**/*'
- 'packages/tsconfig/**/*'
- 'package.json'
check-docs:
docs:
- 'apps/docs/**/*'
- 'packages/eslint-config-custom/**/*'
- 'packages/tsconfig/**/*'
- 'package.json'
- name: Output Needs
id: needs
run: |
echo "check-frontend=${{ steps.changes.outputs.check-frontend == 'true' }}" >> $GITHUB_OUTPUT
echo "check-backend=${{ steps.changes.outputs.check-backend == 'true' }}" >> $GITHUB_OUTPUT
echo "check-docs=${{ steps.changes.outputs.check-docs == 'true' }}" >> $GITHUB_OUTPUT
lint:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'dependabot/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- id: app-token
name: Create GitHub App Token
uses: actions/[email protected]
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}

- name: Setup pnpm
uses: pnpm/[email protected]

- name: Clean install using pnpm
shell: bash
run: pnpm install --filter=docs --frozen-lockfile

- id: require-verified-commits
name: Require verified commits
uses: yumemi-inc/require-verified-commits-action@v1
continue-on-error: true

- id: pr-warnings
name: Find existing warnings in the PR
uses: peter-evans/[email protected]
with:
issue-number: "${{ github.event.pull_request.number }}"
body-includes: "<!-- tag:unverified -->"

- name: Warn unverified commits
if: steps.require-verified-commits.outcome == 'failure' && steps.pr-warnings.outputs.comment-id == ''
run: |
gh pr comment -F - '${{ github.event.pull_request.html_url }}' <<EOS
<!-- tag:unverified -->
@${{ github.event.pull_request.user.login }}
Beep boop...
Pull Request を作成していただきありがとうございます.
突然ですが,この PR に含まれるコミットの一部または全部に署名がされていないようです.
現在の状態では,リポジトリにアクセスできる全員が **あなたになりすましてコミットを作成できます** .
あなたの名前で悪意のあるコミットを作成することも可能といえます.
コミットへの署名は GPG (OpenPGP), S/MIME, または SSH の鍵を使って行えます.
Identity の考え方から GPG の利用を推奨しますが, GitHub ではいずれも Verified となりますので,
ぜひいずれかの設定をお願いします.
コミットへの署名については以下の公式ドキュメントを参照してください:
https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification
公式ドキュメントではないですが,署名がないことによってなりすましが行えるしくみについては以下で説明されています:
https://qiita.com/s6n/items/bb869f740a53a3bf169e
GPG の設定と運用については以下の記事で詳しく説明されています:
https://qiita.com/shun-shobon/items/a944416bebb6207016fb
Happy Coding! 🔑
EOS
echo "frontend=${{ steps.changes.outputs.frontend == 'true' }}" >> $GITHUB_OUTPUT
echo "backend=${{ steps.changes.outputs.backend == 'true' }}" >> $GITHUB_OUTPUT
echo "docs=${{ steps.changes.outputs.docs == 'true' }}" >> $GITHUB_OUTPUT
test-frontend:
check-frontend:
runs-on: ubuntu-22.04
needs: filter
if: needs.filter.outputs.check-frontend == 'true'
needs: changed
if: needs.changed.outputs.frontend == 'true'
permissions:
contents: read
steps:
Expand All @@ -138,10 +73,10 @@ jobs:
- name: Unit Test
run: pnpm run test --filter=frontend...

test-backend:
check-backend:
runs-on: ubuntu-22.04
needs: filter
if: needs.filter.outputs.check-backend == 'true'
needs: changed
if: needs.changed.outputs.backend == 'true'
permissions:
contents: read
steps:
Expand All @@ -161,10 +96,10 @@ jobs:
- name: Unit Test
run: pnpm run test --filter=backend...

test-docs:
check-docs:
runs-on: ubuntu-22.04
needs: filter
if: needs.filter.outputs.check-docs == 'true'
needs: changed
if: needs.changed.outputs.docs == 'true'
permissions:
contents: read
steps:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: preview-${{ github.ref }}
cancel-in-progress: true

jobs:
filter:
changed:
runs-on: ubuntu-22.04

outputs:
publish-docs: ${{ steps.needs.outputs.publish-docs }}
docs: ${{ steps.needs.outputs.docs }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -24,18 +24,18 @@ jobs:
id: changes
with:
filters: |
publish-docs:
docs:
- 'apps/docs/**/*'
- 'package.json'
- name: Output Needs
id: needs
run: |
echo "publish-docs=${{ steps.changes.outputs.publish-docs == 'true' }}" >> $GITHUB_OUTPUT
echo "docs=${{ steps.changes.outputs.docs == 'true' }}" >> $GITHUB_OUTPUT
publish-docs:
preview-docs:
runs-on: ubuntu-22.04
needs: filter
if: needs.filter.outputs.publish-docs == 'true'
needs: changed
if: needs.changed.outputs.docs == 'true'

permissions:
contents: write
Expand Down Expand Up @@ -74,6 +74,6 @@ jobs:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
projectName: web-application-template-docs
directory: ./apps/docs/build
directory: ./apps/docs/dist
gitHubToken: ${{ steps.app-token.outputs.token }}
branch: preview${{ github.ref }}
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.ref }}
cancel-in-progress: true

env:
# 手動実行か否か
IS_DISPATCH: ${{ contains(fromJSON('["workflow_dispatch"]'), github.event_name) }}

jobs:
filter:
changed:
runs-on: ubuntu-22.04

outputs:
publish-docs: ${{ steps.needs.outputs.publish-docs }}
docs: ${{ steps.needs.outputs.docs }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -29,18 +29,18 @@ jobs:
id: changes
with:
filters: |
publish-docs:
docs:
- 'apps/docs/**/*'
- 'package.json'
- name: Output Needs
id: needs
run: |
echo "publish-docs=${{ env.IS_DISPATCH == 'true' || steps.changes.outputs.publish-docs == 'true' }}" >> $GITHUB_OUTPUT
echo "docs=${{ env.IS_DISPATCH == 'true' || steps.changes.outputs.docs == 'true' }}" >> $GITHUB_OUTPUT
publish-docs:
runs-on: ubuntu-22.04
needs: filter
if: needs.filter.outputs.publish-docs == 'true'
needs: changed
if: needs.changed.outputs.docs == 'true'

permissions:
contents: read
Expand Down Expand Up @@ -79,6 +79,6 @@ jobs:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
projectName: web-application-template-docs
directory: ./apps/docs/build
directory: ./apps/docs/dist
gitHubToken: ${{ steps.app-token.outputs.token }}
branch: main
31 changes: 16 additions & 15 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# Dependencies
/node_modules
# build output
dist/
# generated types
.astro/

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
Loading

0 comments on commit a03717f

Please sign in to comment.