-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,10 @@ on: | |
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
REGISTRY: docker.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
SHR_VERSION: ci | ||
DOCKER_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | ||
|
||
jobs: | ||
unit-test: | ||
|
@@ -47,123 +48,36 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
uses: actions/checkout@v4 | ||
- | ||
# Add support for more platforms with QEMU (optional) | ||
# https://github.com/docker/setup-qemu-action | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Change repo info to lowercase | ||
id: string | ||
uses: ASzc/change-string-case-action@v5 | ||
uses: docker/metadata-action@v5 | ||
with: | ||
string: ${{ github.repository }} | ||
|
||
- name: Get Package Version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@main | ||
|
||
- name: Check custom tag | ||
run: echo ${{ env.REGISTRY }}/${{ steps.string.outputs.lowercase }}:${{steps.package-version.outputs.current-version}} | ||
|
||
- name: Build SHR | ||
uses: docker/build-push-action@v3 | ||
images: ${{ env.DOCKER_NAME }} | ||
- | ||
name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
tags: ghcr.io/i-tech-uw/shared-health-record:ci | ||
push: false | ||
load: true | ||
context: . | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
# - name: Pull containers | ||
# run: docker-compose pull shr-fhir openhim-core mongo-db newman kafka zookeeper | ||
|
||
# - name: Cache containers | ||
# uses: satackey/[email protected] | ||
# continue-on-error: true | ||
|
||
# - name: Start containers | ||
# run: docker-compose up -d shr-fhir mongo-db openhim-core kafka zookeeper | ||
|
||
# - name: Load openhim config | ||
# run: docker-compose up -d openhim-config | ||
|
||
# - name: Sleep for 60 seconds | ||
# run: sleep 90s | ||
# shell: bash | ||
|
||
# - name: Display docker logs for openhim config | ||
# run: docker-compose logs openhim-config | ||
|
||
# - name: Run SHR image | ||
# run: docker-compose up -d shr | ||
|
||
# - name: Sleep for 30 seconds | ||
# run: sleep 30s | ||
# shell: bash | ||
|
||
# - name: Show SHR Log | ||
# run: docker-compose logs shr | ||
|
||
# - name: Show kafka Log | ||
# run: docker-compose logs kafka | ||
|
||
# - name: Check openhim-core | ||
# run: curl -sSk https://localhost:8080/heartbeat | ||
|
||
# - name: Show containers | ||
# run: docker-compose ps | ||
|
||
# - name: Show OpenHIM Log | ||
# run: docker-compose logs openhim-core | ||
|
||
# # Postman Testing - see https://www.postman.com/itechuw/workspace/shared-health-record/ | ||
# - name: Run General Tests Collection | ||
# env: | ||
# POSTMAN_COLLECTION: /.postman/collections/1_general_tests.json | ||
# run: docker-compose up -d newman | ||
|
||
# - name: Run Laboratory Workflows Collection (collection/1525496-f28b488f-a40c-4723-8a72-a2b4f64bb5da) | ||
# env: | ||
# POSTMAN_COLLECTION: /.postman/collections/2_laboratory_workflows.json | ||
# run: docker-compose up --exit-code-from newman newman | ||
# continue-on-error: true | ||
|
||
# - name: Run MLLP Tests | ||
# run: docker-compose up --exit-code-from mllp_tests mllp_tests | ||
|
||
# - name: Show SHR Log | ||
# if: always() | ||
# run: docker-compose logs shr | ||
|
||
# - name: Show kafka Log | ||
# if: always() | ||
# run: docker-compose logs kafka | ||
|
||
# - name: Stop containers | ||
# if: always() | ||
# run: docker-compose down | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish Docker image | ||
uses: docker/build-push-action@v3 | ||
if: github.event_name == 'release' | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }},${{ env.REGISTRY }}/${{ steps.string.outputs.lowercase }}:${{steps.package-version.outputs.current-version}} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
load: ${{ github.event_name == 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
cache-from: type=registry,ref=${{github.repository}}:latest | ||
cache-to: type=inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters