From 66d4e3c7b3a6302c12abf8a36c5b14b3c8dd38c2 Mon Sep 17 00:00:00 2001 From: MATSUNAGA Takuya Date: Fri, 6 Dec 2024 12:01:49 +0900 Subject: [PATCH] =?UTF-8?q?GitHub=20Actions=E3=81=AE=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Node.jsのセットアップをv4に更新 - 各ステップのインデントを統一 - `nvmrc`ファイルを使用してNode.jsのバージョンを指定 - GitHub Actionsのアーティファクト関連のバージョンを最新に更新 - `.vscode/settings.json`に`nvmrc`を辞書に追加 --- .github/workflows/deploy.yml | 83 ++++++++++++++++++------------------ .vscode/settings.json | 1 + 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ca326bd..58a04c9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,69 +3,70 @@ name: CI on: push: branches: - - '**' # すべてのブランチでテストを実行 + - "**" # すべてのブランチでテストを実行 jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" - - name: install dependencies - run: | - npm install - - name: run test - run: | - npm run test + - name: install dependencies + run: | + npm install + + - name: run test + run: | + npm run test build: - if: github.ref == 'refs/heads/master' # masterブランチのときのみ実行 + if: github.ref == 'refs/heads/master' # masterブランチのときのみ実行 runs-on: ubuntu-latest needs: test steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" - - name: install dependencies - run: | - npm install - - name: build - run: | - npm run build + - name: install dependencies + run: | + npm install + - name: build + run: | + npm run build - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build - path: ./dist + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build + path: ./dist deploy: - if: github.ref == 'refs/heads/master' # masterブランチのときのみ実行 + if: github.ref == 'refs/heads/master' # masterブランチのときのみ実行 runs-on: ubuntu-latest needs: build steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4.1.7 - with: - name: build - path: ./dist + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build + path: ./dist - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist diff --git a/.vscode/settings.json b/.vscode/settings.json index 1248f6a..752f4a0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "editor.formatOnSave": true, "cSpell.words": [ "Elian", + "nvmrc", "uuidv" ], } \ No newline at end of file