Merge pull request #274 from NaGyeong-Park/main #59
This file contains 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: dev-client CI/CD | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "client/**" | |
jobs: | |
build-image: | |
name: dev-client CI/CD | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Runner 타임존 설정 | |
run: | | |
sudo timedatectl set-timezone 'Asia/Seoul' | |
- name: Node 설정 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "18.x" | |
- name: node_modules 폴더 캐싱 | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: "**/client/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/client/yarn.lock') }} | |
- name: node_modules 폴더 캐시가 없다면 dependencies 설치 | |
working-directory: "./client" | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn | |
- name: 테스트 실행 | |
working-directory: ./client | |
run: | | |
yarn -s test | |
- name: 테스트 결과 발행 | |
uses: n-ryu/[email protected] | |
if: always() | |
with: | |
name: JEST Tests | |
path: client/reports/*.xml | |
reporter: jest-junit | |
- name: Code Coverage 리포트 발행 | |
if: always() | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: unittests | |
- name: Client 소스 build | |
working-directory: "./client" | |
run: yarn build | |
- name: GitHub Container Registry 로그인 | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: kumsil1006 | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Docker images build 및 GitHub Container Registry로 push | |
uses: docker/[email protected] | |
with: | |
push: true | |
tags: ghcr.io/kumsil1006/oao-dev-client | |
context: ./client | |
- name: 실패시 슬랙 메시지 전송 | |
if: ${{ failure() }} | |
uses: ./.github/actions/slack-notify | |
with: | |
slack_incoming_url: ${{ secrets.SLACK_INCOMING_URL }} | |
- name: 성공시 슬랙 메시지 전송 | |
if: ${{ success() }} | |
uses: ./.github/actions/slack-notify | |
with: | |
status: success | |
slack_incoming_url: ${{ secrets.SLACK_INCOMING_URL }} |