Skip to content

Commit

Permalink
Merge pull request #107 from opain/dev
Browse files Browse the repository at this point in the history
Updated workflow for container build
  • Loading branch information
opain authored Jun 13, 2024
2 parents cf47843 + 9482309 commit ef4e4b3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build_deploy_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
inputs:
tag:
description: 'Tag for the release'
required: true
required: false
default: ''

jobs:
build-and-deploy:
Expand All @@ -32,9 +33,13 @@ jobs:
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin

- name: Set Tag
id: set_tag
run: echo "::set-output name=tag::${{ steps.set_tag.outputs.tag || github.sha }}"

- name: Build and Push Docker Image
run: |
docker buildx build --platform linux/amd64 -f $DOCKERFILE_PATH -t $DOCKER_IMAGE_NAME:latest -t $DOCKER_IMAGE_NAME:${{ github.event.inputs.tag }} --push .
docker buildx build --platform linux/amd64 -f $DOCKERFILE_PATH -t $DOCKER_IMAGE_NAME:latest -t $DOCKER_IMAGE_NAME:${{ steps.set_tag.outputs.tag }} --push .
- name: Install Singularity
run: |
Expand All @@ -52,6 +57,6 @@ jobs:
- name: Push Singularity Image to Singularity Library
run: |
singularity push ${GITHUB_WORKSPACE}/image.sif $SINGULARITY_IMAGE_NAME:latest
singularity build ${GITHUB_WORKSPACE}/image_${{ github.event.inputs.tag }}.sif docker-daemon://${DOCKER_IMAGE_NAME}:${{ github.event.inputs.tag }}
singularity push ${GITHUB_WORKSPACE}/image_${{ github.event.inputs.tag }}.sif $SINGULARITY_IMAGE_NAME:${{ github.event.inputs.tag }}
singularity build ${GITHUB_WORKSPACE}/image_${{ steps.set_tag.outputs.tag }}.sif docker-daemon://${DOCKER_IMAGE_NAME}:${{ steps.set_tag.outputs.tag }}
singularity push ${GITHUB_WORKSPACE}/image_${{ steps.set_tag.outputs.tag }}.sif $SINGULARITY_IMAGE_NAME:${{ steps.set_tag.outputs.tag }}

0 comments on commit ef4e4b3

Please sign in to comment.