Skip to content

Commit

Permalink
chore: add ci schema push to schema registry (#16)
Browse files Browse the repository at this point in the history
Push schema to registry only when we have a successful deployment

Signed-off-by: Otieno Calvine <nyarangaotieno@gmail.com>
  • Loading branch information
NYARAS committed Aug 25, 2021
1 parent 0a41c16 commit da97698
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
push:
branches: [develop]

env:
DOCKER_BUILDKIT: 1 # Enable Buildkit and let compose use it to speed up image building
# Schema Registry CLI command version
CLI_VERSION: v0.0.1
# Schema Registry URL
REGISTRY_URL: ${{ secrets.TEST_SCHEMA_REGISTRY_URL }}

concurrency:
group: build_and_push_image

Expand Down Expand Up @@ -75,3 +82,28 @@ jobs:
--set-env-vars "CLOUD_HEALTH_FHIRSTORE_ID=${{ secrets.CLOUD_HEALTH_FHIRSTORE_ID }}" \
--set-env-vars "OPENCONCEPTLAB_TOKEN=${{ secrets.OPENCONCEPTLAB_TOKEN }}" \
--set-env-vars "OPENCONCEPTLAB_API_URL=${{ secrets.OPENCONCEPTLAB_API_URL }}"
push_schema:
name: Publish schema to schema registry
strategy:
matrix:
go-version: [1.16.x]
runs-on: ubuntu-latest
needs: [deploy_to_test]
steps:
- name: Checkout working branches
uses: actions/checkout@v2

# Install Go
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

# install CLI command and push schema to registry
# just to be sure, we re-validate the schema against schema registry
- name: Install CLI command and push schema to registry
run: |
go install github.com/savannahghi/bewellcli@$CLI_VERSION
bewellcli service validate-schema --name clinical --version $GITHUB_SHA --url ${{ secrets.SERVICE_GRAPHQL_URL }}
bewellcli service push-schema --name clinical --version $GITHUB_SHA --url ${{ secrets.SERVICE_GRAPHQL_URL }}

0 comments on commit da97698

Please sign in to comment.