Skip to content

Add Slack Notification step #90

Add Slack Notification step

Add Slack Notification step #90

Workflow file for this run

name: CI Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
name: Config ${{ matrix.config }} on ${{ matrix.operating-system }}
env:
NAME: Config ${{ matrix.config }} on ${{ matrix.operating-system }}
strategy:
fail-fast: false
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:
STATUS: ${{ job.status }}
if: always()
- name: Upload status artifact
uses: actions/upload-artifact@v3
with:
name: status
path: "*.txt"
if: always()
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Check statuses
run: |
for file in status/status_*.txt; do
echo "Checking $file"
cat $file
done
if: always()