[All-Chore] 워크플로우 트리거 추가 및 프론트엔드 스크립트 잘못된 경로 수정 #133
Workflow file for this run
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: be-ci | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| paths: | |
| - "backend/**" | |
| - ".github/workflows/be-ci.yml" | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: corretto | |
| java-version: 17 | |
| cache: gradle | |
| - name: Set up application.yml file | |
| run: | | |
| mkdir -p src/main/resources | |
| echo "${{ secrets.APPLICATION_DEV_YML }}" > src/main/resources/application-dev.yml | |
| shell: bash | |
| - name: Grant Execute Permission for gradlew | |
| run: | | |
| chmod +x gradlew | |
| shell: bash | |
| - name: Build gradle | |
| run: | | |
| ./gradlew clean build -Dspring.profiles.active=dev | |
| shell: bash | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: build/reports/tests/test/ | |
| - name: Upload PR Status | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const statusMap = { | |
| 'success': 'success', | |
| 'failure': 'failure', | |
| 'cancelled': 'cancelled', | |
| 'skipped': 'neutral' | |
| }; | |
| const conclusion = statusMap[process.env.GITHUB_JOB_STATUS] || 'failure'; | |
| const output = { | |
| title: 'Backend CI Result', | |
| summary: `Build ${conclusion}: ${process.env.GITHUB_JOB_STATUS}` | |
| }; | |
| await github.rest.checks.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| name: 'Backend CI', | |
| head_sha: context.payload.pull_request.head.sha, | |
| status: 'completed', | |
| conclusion: conclusion, | |
| output: output | |
| }); | |
| env: | |
| GITHUB_JOB_STATUS: ${{ job.status }} |