Feat: 애플로그인 시 마이페이지 이름 자르기 #242
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: Test Server Pull-request # Workflow 이름 | |
on: | |
pull_request: | |
branches: [ "test" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code. # Repo checkout | |
uses: actions/checkout@v3 | |
- name: Check Node v # Node v 확인 | |
run: node -v | |
- name: Install dependencies # 의존 파일 설치 | |
run: npm install | |
- name: Set .env from secrets | |
run: | | |
echo "PORT=${{ secrets.TEST_PORT }}" > .env | |
echo "WDS_SOCKET_PORT=0" >> .env | |
echo "NODE_PATH=src/" >> .env | |
echo "REACT_APP_API_ROOT=${{ secrets.TEST_REACT_APP_API_ROOT }}" >> .env | |
echo "REACT_APP_HOME_URL=${{ secrets.TEST_REACT_APP_HOME_URL }}" >> .env | |
- name: cat env file | |
run: cat .env | |
- name: Generate build # React Build | |
run: npm run build | |
- name: Discordbot alert # 디스코드 알림 | |
uses: sarisia/[email protected] | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
content: ${{ (github.actor == 'marinesnow34' && '<@392607023495118862>') || | |
(github.actor == '1223v' && '<@368775981667844098>') || | |
(github.actor == 'imi21123' && '<@999337351799128115>') || | |
(github.actor == 'marina-yhm' && '<@946431150614794240>') || | |
(github.actor == 'hhhhyelim' && '<@1076887091427946496>') || | |
(github.actor == 'hhbb0081' && '<@739857755271200892>') }} | |
if: always() | |
after: | |
runs-on: ubuntu-latest | |
needs: build | |
if: always() | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Comment on failure and close PR | |
if: needs.build.result == 'failure' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ github.token }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '빌드 실패' | |
}); | |
github.rest.pulls.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
state: 'closed' | |
}); | |
- name: Auto approve pull request | |
if: needs.build.result == 'success' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ github.token }} | |
script: | | |
github.rest.pulls.createReview({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
pull_number: context.payload.pull_request.number, | |
event: 'APPROVE' | |
}); |