Skip to content

Buid Docker and Push #2

Buid Docker and Push

Buid Docker and Push #2

name: Buid Docker and Push
on:
workflow_run:
workflows:
- PR workflow
types:
- completed
workflow_dispatch:
env:
DOCKER_IMAGE_NAME: outburnltd/fume-fhir-converter
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: login to docker registry
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKER_HUB_TOKEN}}
- name: Get Version
id: get_version
run: |
RELEASE_VERSION=$(jq -r '.version' package.json)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Build Docker image
run: |
docker build --tag $DOCKER_IMAGE_NAME:$RELEASE_VERSION .
- name: Push Docker image
run: |
docker push $DOCKER_IMAGE_NAME:$RELEASE_VERSION
docker tag $DOCKER_IMAGE_NAME:$RELEASE_VERSION $DOCKER_IMAGE_NAME:latest
docker push $DOCKER_IMAGE_NAME:latest
env:
DOCKER_IMAGE_NAME: ${{ env.DOCKER_IMAGE_NAME }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}