🔥 문제
name: CI-front on: push: branches: [ develop, main ] pull_request: branches: [ develop, main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - name: Check out repository uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'npm' - name: Install a project with a clean slate run: rm -rf node_modules && yarn install --frozen-lockfile - name: Lint run: npm run lint - uses: actions/checkout@v2 - name: Install Dependencies working-directory: ./ run: yarn install - name: Build ReactJS env: CI: false working-directory: ./ run: yarn run build - name: Login to DockerHub uses: docker/login-action@v1.8.0 with: username: ${{ secrets.DOCKERHUB_FRONT_USERNAME }} password: ${{ secrets.DOCKERHUB_FRONT_PASSWORD }} - name: Build and push Docker images uses: docker/build-push-action@v2.4.0 with: context: . file: Dockerfile push: true tags: ${{ secrets.DOCKERHUB_FRONT_USERNAME }}/kazedon_fe:latest
⭐ 해결 방법
먼저 중복되는 해당 커맨드를 지웠다.
- name: Install Dependencies working-directory: ./ run: yarn install
또한, 잘 살펴보면
npm
으로 되어 있는 부분을 확인할 수 있다.steps: - name: Check out repository uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'npm' - name: Install a project with a clean slate run: rm -rf node_modules && yarn install --frozen-lockfile - name: Lint run: npm run lint
이를 모두
yarn
으로 대체한다.결국 핵심은,
npm
을 최대한 쓰지 않고 yarn
으로 대체한다는 것이었다.steps: - name: Check out repository uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} cache: 'yarn' - name: Install a project with a clean slate run: rm -rf node_modules && yarn install --frozen-lockfile - name: Lint run: yarn run lint
결과
TLVB-129의 이슈를 보면, 결국 잘 린트 검사를 통과했다!