data-model-validator-update #82
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
name: Test and Deploy | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
repository_dispatch: | |
types: [data-models-update, data-model-validator-update, rpde-validator-update] | |
jobs: | |
test-models: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout validator | |
uses: actions/checkout@v2 | |
with: | |
repository: openactive/data-models | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Install | |
run: npm install | |
- name: Test | |
run: npm test | |
test-data-model-validator: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout validator | |
uses: actions/checkout@v2 | |
with: | |
repository: openactive/data-model-validator | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Install | |
run: npm install | |
- name: Test | |
run: npm test | |
test-rpde-validator: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout validator | |
uses: actions/checkout@v2 | |
with: | |
repository: openactive/rpde-validator | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Install | |
run: npm install | |
- name: Test | |
run: npm test | |
test-site: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout validator site | |
uses: actions/checkout@v2 | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- name: Install | |
run: npm install | |
- name: Test | |
run: npm test | |
deploy-site: | |
needs: [test-site, test-models, test-data-model-validator, test-rpde-validator] | |
if: ${{ github.ref == 'refs/heads/master' }} | |
concurrency: | |
group: validator-staging.openactive.io | |
cancel-in-progress: true | |
environment: | |
name: validator-staging.openactive.io | |
url: https://validator-staging.openactive.io/ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout validator app | |
uses: actions/checkout@v2 | |
with: | |
repository: openactive/data-model-validator-site | |
path: data-model-validator-site | |
- name: Deploy validator app to Heroku | |
uses: behe/heroku-build@v1 | |
with: | |
app-name: data-model-validator-staging | |
api-key: "${{secrets.HEROKU_API_KEY}}" | |
path: data-model-validator-site | |
promote-site: | |
needs: deploy-site | |
if: ${{ github.ref == 'refs/heads/master' }} | |
concurrency: | |
group: validator.openactive.io | |
cancel-in-progress: true | |
environment: | |
name: validator.openactive.io | |
url: https://validator.openactive.io/ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Promote validator app to production | |
uses: tiltshift/heroku-promote-app@v1 | |
with: | |
heroku_app_name: data-model-validator-staging | |
heroku_api_key: "${{secrets.HEROKU_API_KEY}}" | |
heroku_email: "services@openactive.io" |