Skip to content

CI

CI #2691

Workflow file for this run

name: CI
on: [push, pull_request]
env:
API_DEPLOY_PATH: packages/api/dist
API_INTEG_APP_NAME: ops-suite-api-integration
API_PROD_APP_NAME: ops-suite-api-prod
WEBAPP_INTEG_STORAGE_ACCOUNT: 'opssuitewebappinteg'
WEBAPP_PROD_STORAGE_ACCOUNT: 'opssuitewebappprod'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v1
- name: Install Dependencies
run: yarn install
- name: Verification
run: yarn ci
env:
CI: true
- name: Prepare for Deployments
if: matrix.node-version == '14.x' && (github.ref == 'refs/heads/main' || github.ref == 'ref/heads/dev')
run: 'yarn prepare:'
env:
CI: true
- name: Deploy Integ Webapp
run: yarn build:webapp:integ && yarn deploy:webapp
if: matrix.node-version == '14.x' && github.ref == 'refs/heads/dev'
env:
CI: true
WEBAPP_STORAGE_ACCOUNT: ${{ env.WEBAPP_INTEG_STORAGE_ACCOUNT }}
WEBAPP_STORAGE_KEY: ${{ secrets.WEBAPP_INTEG_STORAGE_KEY }}
- name: 'Deploy Integ API'
if: matrix.node-version == '14.x' && github.ref == 'refs/heads/dev'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.API_INTEG_APP_NAME }}
package: ${{ env.API_DEPLOY_PATH }}
publish-profile: ${{ secrets.API_INTEG_PUBLISH_PROFILE }}
- name: Deploy Production Webapp
if: matrix.node-version == '14.x' && github.ref == 'refs/heads/main'
run: yarn build:webapp:prod && yarn deploy:webapp
env:
CI: true
WEBAPP_STORAGE_ACCOUNT: ${{ env.WEBAPP_PROD_STORAGE_ACCOUNT }}
WEBAPP_STORAGE_KEY: ${{ secrets.WEBAPP_PROD_STORAGE_KEY }}
- name: 'Deploy Production API'
if: matrix.node-version == '14.x' && github.ref == 'refs/heads/main'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.API_PROD_APP_NAME }}
package: ${{ env.API_DEPLOY_PATH }}
publish-profile: ${{ secrets.API_PROD_PUBLISH_PROFILE }}
#- name: Publish coverage to codecov.io
# uses: codecov/[email protected]
# with:
# token: ${{ secrets.CODECOV_TOKEN }}