From 0900416a2bd34e16ae424e8b8fff37e1ffc13f8d Mon Sep 17 00:00:00 2001 From: Jun Shindo <46585162+jay-es@users.noreply.github.com> Date: Sat, 19 Apr 2025 12:58:33 +0900 Subject: [PATCH] docs(static-deploy): extract github workflow file for renovate --- .textlintrc | 3 +- guide/static-deploy-github-pages.yaml | 56 +++++++++++++++++++++++++++ guide/static-deploy.md | 54 +------------------------- 3 files changed, 59 insertions(+), 54 deletions(-) create mode 100644 guide/static-deploy-github-pages.yaml diff --git a/.textlintrc b/.textlintrc index ed997831..101e31f2 100644 --- a/.textlintrc +++ b/.textlintrc @@ -12,7 +12,8 @@ "allowlist": { "allow": [ "->", - ">=" + ">=", + "<<<" ] }, "comments": true diff --git a/guide/static-deploy-github-pages.yaml b/guide/static-deploy-github-pages.yaml new file mode 100644 index 00000000..8b793055 --- /dev/null +++ b/guide/static-deploy-github-pages.yaml @@ -0,0 +1,56 @@ +# Imported in static-deploy.md +# This file is extracted as a separate file so that renovate can update the action versions +# +#region content +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ['main'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: 'pages' + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload dist folder + path: './dist' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 +#endregion content diff --git a/guide/static-deploy.md b/guide/static-deploy.md index 0140ada9..12c41d45 100644 --- a/guide/static-deploy.md +++ b/guide/static-deploy.md @@ -63,59 +63,7 @@ $ npm run preview 2. リポジトリー設定ページにある GitHub Pages の設定から、デプロイ元を "GitHub Actions" にすることで、プロジェクトをビルドしてデプロイするワークフローを作成できます。npm を使用して依存関係をインストールし、ビルドするサンプルワークフローが提供されています: - ```yml - # 静的コンテンツを GitHub Pages にデプロイするためのシンプルなワークフロー - name: Deploy static content to Pages - - on: - # デフォルトブランチを対象としたプッシュ時にで実行されます - push: - branches: ['main'] - - # Actions タブから手動でワークフローを実行できるようにします - workflow_dispatch: - - # GITHUB_TOKEN のパーミッションを設定し、GitHub Pages へのデプロイを許可します - permissions: - contents: read - pages: write - id-token: write - - # 1 つの同時デプロイメントを可能にする - concurrency: - group: 'pages' - cancel-in-progress: true - - jobs: - # デプロイするだけなので、単一のデプロイジョブ - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: lts/* - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Build - run: npm run build - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # dist フォルダーのアップロード - path: './dist' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - ``` + <<< ./static-deploy-github-pages.yaml#content ## GitLab Pages と GitLab CI