Skip to content

Sessions tracking support #469

Sessions tracking support

Sessions tracking support #469

name: Lint, Test and Docker Build
on:
push:
branches:
- main
- develop
pull_request:
jobs:
prepare-dependencies:
name: Prepare local deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: prepare-env
uses: ./.github/actions/prepare-local-env
- name: Install dependencies
if: steps.prepare-env.outputs.cache-hit != 'true'
run: npm ci
lint:
name: Lint source code
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-local-env
- name: Lint source code
run: npm run lint
tests:
name: Unit and e2e testing
needs: prepare-dependencies
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-local-env
- name: Make envfile
uses: SpicyPizza/create-envfile@v2
with:
envkey_APPLICATION_HOST: ${{ secrets.APPLICATION_HOST }}
envkey_APPLICATION_PORT: ${{ secrets.APPLICATION_PORT }}
envkey_APPLICATION_JWT_SECRET: ${{ secrets.APPLICATION_JWT_SECRET }}
envkey_APPLICATION_DB_HOST: ${{ secrets.APPLICATION_DB_HOST }}
envkey_APPLICATION_DB_USERNAME: ${{ secrets.APPLICATION_DB_USERNAME }}
envkey_APPLICATION_DB_PASSWORD: ${{ secrets.APPLICATION_DB_PASSWORD }}
envkey_APPLICATION_DB_DATABASE: ${{ secrets.APPLICATION_DB_DATABASE }}
envkey_APPLICATION_DB_PORT: ${{ secrets.APPLICATION_DB_PORT }}
envkey_APPLICATION_DB_DIALECT: ${{ secrets.APPLICATION_DB_DIALECT }}
envkey_APPLICATION_REDIS_HOST: ${{ secrets.APPLICATION_REDIS_HOST }}
envkey_APP_SESSION_ID_SECRET: ${{ secrets.APP_SESSION_ID_SECRET }}
envkey_JEST_WORKERS_AMOUNT: ${{ secrets.JEST_WORKERS_AMOUNT }}
envkey_SHOW_LOGS_IN_TESTS: ${{ secrets.SHOW_LOGS_IN_TESTS }}
envkey_API_LAYER_API_KEY: ${{ secrets.API_LAYER_API_KEY }}
envkey_GRAFANA_LOKI_HOST: ${{ secrets.GRAFANA_LOKI_HOST }}
envkey_GRAFANA_LOKI_AUTH: ${{ secrets.GRAFANA_LOKI_AUTH }}
envkey_GRAFANA_LOKI_USER_ID: ${{ secrets.GRAFANA_LOKI_USER_ID }}
directory: ./
file_name: .env.test
- name: Unit and e2e testing
run: npm run test
docker-build:
name: Build source code using Docker
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Make envfile
uses: SpicyPizza/create-envfile@v2
with:
envkey_APPLICATION_HOST: ${{ secrets.APPLICATION_HOST }}
envkey_APPLICATION_PORT: ${{ secrets.APPLICATION_PORT }}
envkey_APPLICATION_JWT_SECRET: ${{ secrets.APPLICATION_JWT_SECRET }}
envkey_APPLICATION_DB_HOST: ${{ secrets.APPLICATION_DB_HOST }}
envkey_APPLICATION_DB_USERNAME: ${{ secrets.APPLICATION_DB_USERNAME }}
envkey_APPLICATION_DB_PASSWORD: ${{ secrets.APPLICATION_DB_PASSWORD }}
envkey_APPLICATION_DB_DATABASE: ${{ secrets.APPLICATION_DB_DATABASE }}
envkey_APPLICATION_DB_PORT: ${{ secrets.APPLICATION_DB_PORT }}
envkey_APPLICATION_DB_DIALECT: ${{ secrets.APPLICATION_DB_DIALECT }}
envkey_APPLICATION_REDIS_HOST: ${{ secrets.APPLICATION_REDIS_HOST }}
envkey_APP_SESSION_ID_SECRET: ${{ secrets.APP_SESSION_ID_SECRET }}
envkey_JEST_WORKERS_AMOUNT: ${{ secrets.JEST_WORKERS_AMOUNT }}
envkey_SHOW_LOGS_IN_TESTS: ${{ secrets.SHOW_LOGS_IN_TESTS }}
envkey_API_LAYER_API_KEY: ${{ secrets.API_LAYER_API_KEY }}
envkey_GRAFANA_LOKI_HOST: ${{ secrets.GRAFANA_LOKI_HOST }}
envkey_GRAFANA_LOKI_AUTH: ${{ secrets.GRAFANA_LOKI_AUTH }}
envkey_GRAFANA_LOKI_USER_ID: ${{ secrets.GRAFANA_LOKI_USER_ID }}
directory: ./
file_name: .env.production
- uses: ./.github/actions/docker-build
with:
docker-hub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
docker-hub-access-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}