mirror of https://github.com/tycrek/ass
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.2 KiB
67 lines
2.2 KiB
name: "Docker Build"
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, dev/0.15.0 ]
|
|
|
|
jobs:
|
|
build_and_push:
|
|
name: Build & Publish Docker Images
|
|
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev/0.15.0') && contains(github.event.head_commit.message, '[docker build]')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Wait for build to succeed
|
|
uses: lewagon/wait-on-check-action@master
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
check-name: build
|
|
repo-token: ${{ secrets.GH_TOKEN }}
|
|
allowed-conclusions: success
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
build-args: |
|
|
COMMIT_TAG=${{ github.sha }}
|
|
tags: |
|
|
tycrek/ass:latest
|
|
tycrek/ass:${{ github.sha }}
|
|
discord:
|
|
name: Send Discord Notification
|
|
needs: build_and_push
|
|
if: always() && github.event_name != 'pull_request' && contains(github.event.head_commit.message, '[docker build]')
|
|
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
|