Infra/discord webhook 설정 #23
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
# .github/workflows/my-project.yml | |
name: PPAC | |
on: | |
pull_request: | |
branches: [ develop ] | |
jobs: | |
build: | |
name: test action | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Access Available | |
run: chmod +x Scripts/onboarding.sh | |
- name: Install Setup Script and Fetch Dependencies | |
run: ./Scripts/onboarding.sh | |
- name: Source bashrc | |
shell: bash -l {0} | |
run: source ~/.bashrc && mise doctor | |
- name: Install tuist | |
shell: bash -l {0} | |
run: mise install | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: mise exec -- tuist install | |
- name: Build and Test | |
id: build_and_test | |
shell: bash -l {0} | |
run: mise exec -- tuist test PPACIOS-Workspace | |
- name: Set build status to success | |
if: ${{ success() }} | |
run: echo "BUILD_STATUS=success" >> $GITHUB_ENV | |
- name: Set build status to failure | |
if: ${{ failure() }} | |
run: echo "BUILD_STATUS=failure" >> $GITHUB_ENV | |
outputs: | |
build_status: ${{ steps.build_and_test.outcome }} | |
notify-success: | |
name: Notify Discord on Success | |
runs-on: ubuntu-latest | |
needs: build | |
if: success() | |
steps: | |
- name: Notify Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: "✅ Tests passed for \nPR: ${{ github.event.pull_request.title }}. \nPR URL: ${{ github.event.pull_request.html_url }}" | |
notify-failure: | |
name: Notify Discord on Failure | |
runs-on: ubuntu-latest | |
needs: build | |
if: failure() | |
steps: | |
- name: Notify Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: "❌ Tests failed for \nPR: ${{ github.event.pull_request.title }}.\nPR URL: ${{ github.event.pull_request.html_url }}" | |