Skip to content

Commit

Permalink
Merge pull request #136 from reagan-meant/ISSUE-135
Browse files Browse the repository at this point in the history
ISSUE-135: Automate image deployment of images
  • Loading branch information
ashaban authored Jun 13, 2024
2 parents bb06e1a + 9678006 commit b3f0e58
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/dockerhubES.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Create and publish Elastic Search Docker image to Docker hub

on:
push:
branches:
- "master"
release:
workflow_dispatch:

env:
REGISTRY: docker.io
IMAGE_NAME: intrahealth/elasticsearch

jobs:
build-and-push-es-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Docker registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch,pattern=main,latest=true
type=ref,event=tag
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./docker/elasticsearch
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
47 changes: 47 additions & 0 deletions .github/workflows/dockerhubopencr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Create and publish OpencCR Docker image to Docker hub

on:
push:
branches:
- "master"
release:
workflow_dispatch:

env:
REGISTRY: docker.io
IMAGE_NAME: intrahealth/opencr

jobs:
build-and-push-opencr-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Docker registry
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch,pattern=main,latest=true
type=ref,event=tag
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./docker/opencr
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit b3f0e58

Please sign in to comment.