[mock] 테스트마다 mock 데이터 초기화하고 id 생성 함수 사용한다 #71
Workflow file for this run
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: Frontend CI/CD | |
on: | |
pull_request: | |
branches: [dev] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
run: yarn install | |
- name: Build production bundle | |
run: yarn build | |
- name: Run tests | |
timeout-minutes: 5 | |
run: yarn test | |
automerge: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- id: automerge | |
name: automerge | |
uses: 'pascalgn/automerge-action@v0.15.6' | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
MERGE_LABELS: 'automerge,!inprogress' | |
MERGE_REMOVE_LABELS: 'automerge' | |
MERGE_METHOD: 'rebase' | |
MERGE_FORKS: 'false' | |
MERGE_REQUIRED_APPROVALS: '0' | |
UPDATE_METHOD: 'rebase' | |
deploy: | |
runs-on: ubuntu-latest | |
needs: automerge | |
steps: | |
- name: deploy client | |
uses: appleboy/ssh-action@v1.0.0 | |
with: | |
host: ${{ secrets.AWS_SSH_HOST }} | |
username: ${{ secrets.AWS_SSH_USERNAME }} | |
key: ${{ secrets.AWS_SSH_KEY }} | |
port: ${{ secrets.AWS_SSH_PORT }} | |
script: | | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
sudo rm -r ~/web/* | |
cd ~/toquiz-client | |
git checkout dev | |
git pull origin dev | |
yarn install | |
yarn build | |
sudo mv dist/* ~/web/ |