Skip to content

Publish Docker image #8

Publish Docker image

Publish Docker image #8

Workflow file for this run

name: Publish Docker image
on:
workflow_run:
workflows: ["Gradle CI"]
types: [completed]
jobs:
build-and-push:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'release' }}
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
build-args: |
RELEASE_VERSION=${{ github.event.workflow_run.head_branch }}
tags: |
ghcr.io/apdevteam/modmail:${{ github.event.workflow_run.head_branch }}
ghcr.io/apdevteam/modmail:latest