78 lines
2.2 KiB
YAML
78 lines
2.2 KiB
YAML
name: Edge build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- '**.ts'
|
|
- 'src/**'
|
|
- 'schema/**'
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build & publish Edge Docker image
|
|
if: ${{ github.event_name == 'workflow_dispatch' }} || github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]')
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
steps:
|
|
- name: Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ghcr.io/${{ github.repository }}
|
|
tags: |
|
|
type=edge
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
publish-docs:
|
|
name: Publish edge documentation
|
|
needs: build-and-push
|
|
permissions:
|
|
contents: write
|
|
uses: psyko-gh/overcrawlrr/.github/workflows/docs.yaml@master
|
|
with:
|
|
version: edge
|
|
|
|
discord:
|
|
name: Send Discord Notification
|
|
needs: [build-and-push, publish-docs]
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get Build Job Status
|
|
uses: technote-space/workflow-conclusion-action@v3
|
|
- name: Combine Job Status
|
|
id: status
|
|
run: |
|
|
failures=(neutral, skipped, timed_out, action_required)
|
|
if [[ ${array[@]} =~ $WORKFLOW_CONCLUSION ]]; then
|
|
echo "status=failure" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "status=$WORKFLOW_CONCLUSION" >> $GITHUB_OUTPUT
|
|
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
|