Skip to content

feat:github action init #1

feat:github action init

feat:github action init #1

Workflow file for this run

# 任意のワークフローの名前を定義
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のバージョンを指定

Check failure on line 37 in .github/workflows/nextjs-ci.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/nextjs-ci.yaml

Invalid workflow file

You have an error in your yaml syntax on line 37
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