Skip to content

Build Container Image & Push To GitHub Container Registry #78

Build Container Image & Push To GitHub Container Registry

Build Container Image & Push To GitHub Container Registry #78

name: Build Container Image & Push To GitHub Container Registry
on:
workflow_run:
workflows: [ "Tests" ]
branches: [ "main" ]
types: [ "completed" ]
workflow_dispatch:
jobs:
build-and-push-container-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push'
steps:
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
push: true
# noinspection SpellCheckingInspection
tags: ghcr.io/cssuob/tex-bot-py-v2:latest
cache-from: type=gha
cache-to: type=gha,mode=max