Skip to content

update github actions #48

update github actions

update github actions #48

# This file was generated using Kotlin DSL (.github/workflows/docker_workflow.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'Docker build & push'
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/docker_workflow.yaml'' && ''.github/workflows/docker_workflow.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/docker_workflow.yaml'''
build_job:
name: 'Build Job'
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
with:
fetch-depth: '0'
- id: 'step-1'
name: 'Docker Login'
uses: 'docker/login-action@v3'
with:
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
password: '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}'
- id: 'step-2'
name: 'Docker Setup buildx'
uses: 'docker/setup-buildx-action@v3'
- id: 'step-3'
name: 'Build and push'
uses: 'docker/build-push-action@v5'
with:
context: '.'
file: './Dockerfile'
push: 'true'
tags: '${{ secrets.DOCKER_HUB_USERNAME }}/${{ secrets.DOCKER_HUB_REPOSITORY }}:latest'
- id: 'step-4'
name: 'image digest'
run: 'echo ${{ steps.step-3.outputs.digest }}'
discord_notification:
name: 'Discord Notification'
runs-on: 'ubuntu-latest'
needs:
- 'build_job'
- 'check_yaml_consistency'
if: '${{ always() }}'
steps:
- id: 'step-0'
name: 'Discord Workflow Status Notifier'
uses: 'nobrayner/discord-webhook@v1'
with:
github-token: '${{ github.token }}'
discord-webhook: '${{ secrets.WEBHOOK_URL }}'
include-details: 'true'
if: 'always()'