Add Slack Notification step #79
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: CI Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Job ${{ matrix.config }} | |
strategy: | |
matrix: | |
config: [1, 2, 3] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build successfully | |
run: echo "SUCCESS" | |
#run only if config is 1 or 3 | |
if: matrix.config == 1 || matrix.config == 3 | |
- name: Build failed | |
run: echo "FAILED" && exit 1 | |
#run only if config is 2 | |
if: matrix.config == 2 | |
- name: Save status artifact | |
run: | | |
echo "Job ${NAME}: ${STATUS}" > "status_${NAME}.txt" | |
env: | |
NAME: ${{ matrix.config }} | |
STATUS: ${{ job.status }} | |
if: always() | |
- name: Upload status artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: status_${{ matrix.config }} | |
path: status_${{ matrix.config }}.txt | |
if: always() | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v2 | |
- name: Check statuses | |
run: | | |
for file in status_*.txt; do | |
echo "Checking $file" | |
cat $file | |
done | |
if: always() |