Skip to content

Workflow file for this run

# This worklflow will perform following actions when a release is published:
# - Fetch Latest release.
# - Build the latest docker image in production.
# - Push the docker image to Github Artifact Registry-Prod.
#
# Maintainers:
# - name: Nisha Sharma
# - email: [email protected]
name : Prod Build, Test and Publish
on:
release:
types: [published]
env:
DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }}
DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
REPOSITORY_NAME: cheminformatics-microservice
REPOSITORY_NAMESPACE: nfdi4chem
jobs:
push_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Fetch latest release
id: fetch-latest-release
uses: InsonusK/[email protected]
with:
myToken: ${{ github.token }}
exclude_types: "draft"
view_top: 10
- name: "Print release name"
run: |
echo "tag_name: ${{ steps.fetch-latest-release.outputs.tag_name }}"
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_PASSWORD }}
- name: Build and push full Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
build-args: |
RELEASE_VERSION=${{ steps.fetch-latest-release.outputs.tag_name }}
tags: |
${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ steps.fetch-latest-release.outputs.tag_name }}
${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:latest
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_PASSWORD }}
- name: Build and push lite Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.lite
push: true
build-args: |
RELEASE_VERSION=${{ steps.fetch-latest-release.outputs.tag_name }}
tags: |
${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ steps.fetch-latest-release.outputs.tag_name }}-lite
${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:latest-lite
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_PASSWORD }}