Skip to content

Build and Push Docker image #27

Build and Push Docker image

Build and Push Docker image #27

Workflow file for this run

name: Build and Push Docker image
on:
workflow_run:
workflows:
- Tests
branches:
- main
types:
- completed
jobs:
build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
ghcr.io/mardi4nfdi/askmardi_embedding_updater:latest
ghcr.io/mardi4nfdi/askmardi_embedding_updater:${{ github.event.workflow_run.head_sha }}
- name: Verify pushed image
run: docker pull ghcr.io/mardi4nfdi/askmardi_embedding_updater:latest