Skip to content

Commit 999047c

Browse files
authored
Merge pull request #1150 from jembi/OHM-1090-add-github-action
OHM-1090 Add github actions config to build and push docker image
2 parents 1311149 + 5064a0d commit 999047c

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/workflows/master.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Push OpenHIM Core Docker Image On Commit To Master
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [14.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v1
23+
with:
24+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
25+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
26+
27+
- name: Set up Docker Buildx
28+
id: buildx
29+
uses: docker/setup-buildx-action@v1
30+
31+
- name: Build and push
32+
id: docker_build
33+
uses: docker/build-push-action@v2
34+
with:
35+
context: ./
36+
file: ./Dockerfile
37+
push: true
38+
tags: jembi/openhim-core:latest

.github/workflows/tags.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Push OpenHIM Core Docker Image On Tag
2+
3+
on:
4+
push:
5+
tags: ['*']
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14.x]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set env
21+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
22+
23+
- name: Login to Docker Hub
24+
uses: docker/login-action@v1
25+
with:
26+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
27+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
28+
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v1
32+
33+
- name: Build and push
34+
id: docker_build
35+
uses: docker/build-push-action@v2
36+
with:
37+
context: ./
38+
file: ./Dockerfile
39+
push: true
40+
tags: jembi/openhim-core:${{ env.RELEASE_VERSION }}

0 commit comments

Comments
 (0)