Skip to content

Add Slack Notification step #78

Add Slack Notification step

Add Slack Notification step #78

Workflow file for this run

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@v2
- 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: ${{ job.name }}
STATUS: ${{ job.status }}
if: always()
- name: Upload status artifact
uses: actions/upload-artifact@v2
with:
name: status_${{ job.name }}
path: status_${{ job.name }}.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()