Skip to content

enabling image build when pushing to develop branch #20

enabling image build when pushing to develop branch

enabling image build when pushing to develop branch #20

name: Create Release
on:
push:
branches:
- main
- develop
jobs:
create-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub Action
uses: actions/checkout@main
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Image Name
run: |
COMMIT_HASH=${{ github.sha }}
if [ "$GITHUB_REF_NAME" = "develop" ]; then
IMAGE_NAME="ghcr.io/mydigitwinnl/federated_cvdm_training_poc_testing:latest"
else
IMAGE_NAME="ghcr.io/mydigitwinnl/federated_cvdm_training_poc:${COMMIT_HASH}"
fi
- name: Run Makefile Rule
run: |
${IMAGE_NAME}
- name: Push Docker image
run: |
${IMAGE_NAME}