build(workflows): Update workflows to use ubuntu-20.04 (#684)

Added discord notifications to all build jobs
This commit is contained in:
samwiseg0
2021-01-18 20:17:24 -05:00
committed by GitHub
parent 3b4892bcd7
commit f2b9125acd
5 changed files with 64 additions and 15 deletions

View File

@@ -10,7 +10,8 @@ on:
jobs:
test:
runs-on: ubuntu-18.04
name: Lint & Test Build
runs-on: ubuntu-20.04
container: node:12.18-alpine
steps:
- name: checkout
@@ -24,10 +25,10 @@ jobs:
- name: build
run: yarn build
build_and_push:
name: Build and push Docker image to Docker Hub
name: Build & Publish to Docker Hub
needs: test
if: github.ref == 'refs/heads/develop' && !contains(github.event.head_commit.message, 'skip ci')
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
@@ -59,3 +60,28 @@ jobs:
sctx/overseerr:${{ github.sha }}
ghcr.io/sct/overseerr:develop
ghcr.io/sct/overseerr:${{ github.sha }}
discord:
name: Send Discord Notification
needs: build_and_push
runs-on: ubuntu-20.04
steps:
- name: Get Build Job Status
uses: technote-space/workflow-conclusion-action@v1
- name: Combine Job Status
id: status
run: |
failures=(neutral, skipped, timed_out, action_required)
if [[ ${array[@]} =~ $WORKFLOW_CONCLUSION ]]; then
echo ::set-output name=status::failure
else
echo ::set-output name=status::$WORKFLOW_CONCLUSION
fi
- name: Post Status to Discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
status: ${{ steps.status.outputs.status }}
title: ${{ github.workflow }}
nofail: true