Skip to content

Commit

Permalink
feat:github action init
Browse files Browse the repository at this point in the history
  • Loading branch information
abcdegolira committed Jul 5, 2024
1 parent 39f47dc commit f504357
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/nextjs-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 任意のワークフローの名前を定義
name: nextjs-ci

#どのGitHubイベントに対して実行されるかを定義
on:
# メインブランチにpushがあったときにワークフローを実行
push:
branches: [ main ]
# メインブランチに対するプルリクエストが作成されたときにワークフローを実行
pull_request:
branches: [ main ]

# このワークフローで実行されるジョブを定義
jobs:
# ジョブの名前を定義
nextjs-ci:

# このジョブを実行する環境(GitHub Actionsランナー)を指定
# 今回はubuntuを指定
runs-on: ubuntu-latest

strategy:
matrix:
# 使用するNode.jsのバージョンを定義
node-version: [18.14.1]

# 自動化したい作業を定義
steps:
# 実行環境にソースコードを取り込む
- uses: actions/checkout@v3
# 実行環境に対してNode.jsのセットアップをする
# 作業に任意の名前を定義
- name: Use Node.js ${{ matrix.node-version }}
# Node.jsのセットアップに必要な設定
uses: actions/setup-node@v3
with:
# Node.jsのバージョンを指定
node-version: ${{ matrix.node-version }}
# yarnのキャッシュを使用する設定
cache: 'yarn'
# 作業に任意の名前を定義
- name: Install dependencies
# プロジェクトの依存関係をインストール
run: npm install
# 作業に任意の名前を定義
- name: Format code
# Prettierでフォーマット
run: npm prettier
# 作業に任意の名前を定義
- name: Lint code
# ESLintで静的解析の実行
run: npm lint
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"prettier": "next prettier",
"test": "jest",
"test:watch": "jest --watch",
"test:e2e": "playwright test"
Expand Down

0 comments on commit f504357

Please sign in to comment.