Investments tracking #414
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: Lint, Test and Docker Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
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_JEST_WORKERS_AMOUNT: ${{ secrets.JEST_WORKERS_AMOUNT }} | |
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_JEST_WORKERS_AMOUNT: ${{ secrets.JEST_WORKERS_AMOUNT }} | |
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 }} |