Skip to content

Build Container Image & Push To GitHub Container Registry #25

Build Container Image & Push To GitHub Container Registry

Build Container Image & Push To GitHub Container Registry #25

name: Build Container Image & Push To GitHub Container Registry
on:
workflow_run:
workflows: [ "Tests" ]
branches: [ "main" ]
types: [ "completed" ]
workflow_dispatch:
jobs:
build-and-push-prod-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@v6
with:
push: true
tags: ghcr.io/cssuob/tex-bot-py-v2:latest
cache-from: type=gha
cache-to: type=gha,mode=max