Skip to content

Create project, add server with endpoints for health readiness and 10… #3

Create project, add server with endpoints for health readiness and 10…

Create project, add server with endpoints for health readiness and 10… #3

Workflow file for this run

name: CI build
on:
push:
branches: ["main"]
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: ".nvmrc"
- name: NPM install
run: npm install
- name: Compile to JavaScript
run: npm run build
- name: Pact - Run consumer tests
run: npm run pact:consumer
- name: Pact - Provider verify local pacts
run: npm run pact:provider
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
- name: Pact - Publish consumer pacts
run: npm run pact:publish-consumer
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
- name: Pact - Provider verify PactFlow pacts
run: npm run pact:provider
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
USE_PACTFLOW: true
PUBLISH_VERIFICATION_RESULTS: false
- name: Pact - Can-i-deploy - Provider
run: npm run pact:can-i-deploy-provider
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
- name: Pact - Record release - Provider
run: npm run pact:release-provider
if: ${{ github.ref == 'refs/heads/main' }}
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
- name: Pact - Can-i-deploy - Consumer
run: npm run pact:can-i-deploy-consumer
if: ${{ github.ref == 'refs/heads/main' }}
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}
- name: Pact - Record release - Consumer
run: npm run pact:release-consumer
if: ${{ github.ref == 'refs/heads/main' }}
env:
BRANCH_NAME: ${{ github.ref }}
PACT_BROKER_URL: ${{ vars.PACT_BROKER_URL }}
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }}