diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index e267d7a6..aad26687 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -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 @@ -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 }}