CI CD작업을 합니다.
CI/CD는 지속적인 통합(Continuous Integration)과 지속적인 제공/배포(Continuous Delivery/Deployment)의 약자입니다.
개발부터 배포까지의 모든 과정을 자동화하여 빠르고 안정적으로 사용자에게 서비스를 제공할 수 있습니다.
Continuous Delivery (지속적인 제공)
Continuous Deployment (지속적인 배포)


name: CI - Lint, Build
on: pull_request
jobs:
CI-Lint-Build:
name: run lint, build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
# 패키지가 변경될 때만 재설치
- name: Cache npm
uses: actions/cache@v4
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install
- run: npm run lint
if: ${{ always() }} # 에러가 난 경우에도 뒤의 작업을 실행함
- run: npm run build
if: ${{ always() }}