Merge branch 'master' into sidebar-style #610
Workflow file for this run
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: backend | |
on: push | |
jobs: | |
files-changed: | |
name: Detect File Changes - backend/ | |
runs-on: ubuntu-latest | |
outputs: | |
backend: ${{ steps.filter.outputs.backend }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/[email protected] | |
id: filter | |
with: | |
filters: | | |
backend: | |
- '.github/workflows/**/*' | |
- 'backend/**/*' | |
build: | |
if: needs.files-changed.outputs.backend == 'true' | |
name: Build - Backend | |
needs: files-changed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: './.tool-versions' | |
- name: Backend | Build | |
run: npm install && npm run build | |
working-directory: ./backend | |
docker-production: | |
if: needs.files-changed.outputs.backend == 'true' | |
name: Build Docker Production - Backend | |
needs: files-changed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Backend | Build Docker Production | |
run: docker compose -f docker-compose.yml build backend | |
docker-development: | |
if: needs.files-changed.outputs.backend == 'true' | |
name: Build Docker Development - Backend | |
needs: files-changed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Backend | Build Docker Development | |
run: docker compose build backend | |
lint: | |
if: needs.files-changed.outputs.backend == 'true' | |
name: Lint - Backend | |
needs: files-changed | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: './.tool-versions' | |
- name: Backend | Lint | |
run: npm install && npm run test:lint | |
working-directory: ./backend | |
unit: | |
if: needs.files-changed.outputs.backend == 'true' | |
name: Unit - Backend | |
needs: files-changed | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: mysql://root:@localhost:3306/dreammall.earth | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: './.tool-versions' | |
- name: Backend | docker-compose database | |
run: docker compose -f docker-compose.yml up --detach --no-deps database | |
- name: Backend | Unit | |
run: npm install && cp src/auth/public.pem . && npm run db:migrate && npm run test:unit | |
working-directory: ./backend |