Skip to content

Feat/remove team locking #499

Feat/remove team locking

Feat/remove team locking #499

Workflow file for this run

name: CI
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn prisma generate
- run: yarn lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn prisma generate
- run: yarn build
test:
runs-on: ubuntu-latest
env:
# Used for prisma generation
DATABASE_URL: mysql://test:test@localhost:3306/arena
services:
mariadb:
image: mariadb:10
env:
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: arena
MYSQL_RANDOM_ROOT_PASSWORD: yes
ports:
- 3306:3306
options: --name mariadb --health-cmd="mysqladmin ping" --health-interval=1s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn prisma generate
- run: yarn prisma db push
- run: docker exec -i mariadb mysql -utest -ptest arena < seed.sql
- run: yarn test:coverage
- uses: codecov/codecov-action@v1
deploy-dbdocs:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs:
- lint
- build
- test
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn prisma generate
- env:
BRANCH: ${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
DBDOCS_TOKEN: ${{ secrets.DBDOCS_TOKEN }}
run: yarn dbdocs build dbml/schema.dbml --project=${{ env.BRANCH }}
deploy:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
needs:
- lint
- build
- test
env:
RESOURCE_NAME: ${{ github.ref == 'refs/heads/master' && 'prod-api' || 'dev-api' }}
steps:
- uses: actions/checkout@v2
- name: Install oc
uses: redhat-actions/oc-installer@v1
with:
oc_version: '4.6'
- name: Login to OKD
run: oc login --token=${{ secrets.OKD_TOKEN }} --server=${{ secrets.OKD_SERVER }}
- name: Change the project
run: oc project ${{ secrets.OKD_PROJECT }}
- name: Start the build
run: oc start-build ${{ env.RESOURCE_NAME }} --follow
- uses: lazy-actions/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: '*Deployment to ${{ env.RESOURCE_NAME }}*'
commit: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}
token: ${{ secrets.GITHUB_TOKEN }}