Skip to content
name: BCAT build and deploy to OpenShift (prod)
on:
pull_request:
types: [closed]
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./.pipeline
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Build BCAT app
run: |
oc version
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }}
npm ci
DEBUG=* npm run build -- --pr=${{ github.event.pull_request.number }} --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}}
deploy-to-prod:
needs: [build]
environment:
name: prod
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./.pipeline
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- name: Deploy to prod
run: |
oc version
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }}
npm ci
DEBUG=* npm run deploy -- --pr=${{ github.event.pull_request.number }} --env=prod --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}}