ci: yarn 캐시 및 Corepack 설정 개선 #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup Corepack | |
| run: | | |
| corepack enable | |
| corepack prepare [email protected] --activate | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
| - name: Cache yarn dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| key: yarn-cache-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| yarn-cache- | |
| - name: Install Dependencies | |
| run: | | |
| yarn install --immutable --inline-builds | |
| - name: Build shared packages | |
| run: | | |
| echo "Building @meme-wiki/ui..." | |
| yarn workspace @meme-wiki/ui tsc --noEmit | |
| yarn workspace @meme-wiki/ui lint | |
| yarn workspace @meme-wiki/ui build | |
| echo "Building @meme-wiki/apis..." | |
| yarn workspace @meme-wiki/apis tsc --noEmit | |
| yarn workspace @meme-wiki/apis lint | |
| yarn workspace @meme-wiki/apis build | |
| - name: Build web application | |
| run: | | |
| echo "Building @meme-wiki/web..." | |
| yarn workspace @meme-wiki/web lint | |
| yarn workspace @meme-wiki/web build |