From c7b15db61feb24884716fb5de555e4206dd8367a Mon Sep 17 00:00:00 2001 From: Kaito Sugimoto Date: Mon, 9 Sep 2024 22:17:28 +0900 Subject: [PATCH] Revert "update workflow file" This reverts commit 718ab0cd56a8f4b96aa07ec91f47a42af9134378. --- .github/workflows/gh-pages.yml | 49 +++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 980be21..842730c 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,39 +1,56 @@ -name: Deploy to GitHub Pages +name: Astro with GitHub Pages on: - # `main` ブランチにプッシュするたびにワークフローを実行します - # 異なるブランチ名を使用する場合は、`main` をブランチ名に置き換えてください + # Runs on pushes targeting the default branch push: - branches: [ main ] - # このワークフローを GitHub の Actions タブから手動で実行できるようにします。 + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# このジョブがリポジトリをクローンし、ページデプロイメントを作成することを許可します。 +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: + # Build job build: runs-on: ubuntu-latest steps: - - name: Checkout your repository using git + - name: Checkout uses: actions/checkout@v4 - - name: Install, build, and upload your site - uses: withastro/action@v1 - # with: - # path: . # リポジトリ内のAstroプロジェクトのルートロケーション。(オプション) - # node-version: 18 # サイト構築に使用するNodeのバージョン。デフォルトは18です。(オプション) - # package-manager: pnpm@latest # 依存関係のインストールとサイトのビルドに使用する Node パッケージマネージャ。ロックファイルに基づいて自動的に検出されます。(オプション) + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Install dependencies + run: yarn install + - name: Build with Astro + run: yarn build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: dist + # Deployment job deploy: - needs: build - runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 \ No newline at end of file + uses: actions/deploy-pages@v4