Files
noahspan-flying/.gitea/workflows/build_and_test.yaml
noahspannbauer 674ae1cf3c
All checks were successful
Pull Request / changes (pull_request) Successful in 25s
Pull Request / build (pull_request) Has been skipped
updating log interceptor for read role
2026-05-20 21:27:06 -05:00

74 lines
2.0 KiB
YAML

name: 'API Build'
on:
workflow_call:
inputs:
environment_name:
required: true
type: string
version_number:
required: true
type: string
jobs:
build-and-test:
runs-on: ubuntu-latest
environment: ${{ inputs.environment_name }}
steps:
- name: Checkout
uses: https://gitea.com/actions/checkout@v6
with:
sparse-checkout: |
api
client
- name: Install Nest CLI
run: |
npm install -g @nestjs/cli
- name: 'Setup Node'
uses: actions/setup-node@v4
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Install dependencies
run: |
npm ci
- name: Build API
run: |
npm run build -w api
- name: Test API
run: |
npm run test -w api
- name: Build Client
env:
VITE_API_URL: ${{ vars.VITE_API_URL }}
VITE_BASE_URL: ${{ case(inputs.environment_name === 'test', vars.VITE_BASE_URL_TEST, vars.VITE_BASE_URL_PROD) }}
VITE_CLIENT_ID: ${{ case(inputs.environment_name === 'test', vars.VITE_CLIENT_ID_TEST, vars.VITE_CLIENT_ID_PROD) }}
VITE_ISSUER_URI: ${{ vars.VITE_ISSUER_URI }}
VITE_TENANT_ID: ${{ vars.VITE_TENANT_ID }}
run: |
printenv
npm run build -w client
- name: Log into Docker Hub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Docker Buildx
if: ${{ github.event_name != 'pull_request' }}
uses: docker/setup-buildx-action@v3
- name: Build and push to registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/build-push-action@v6
with:
push: true
tags: noahspan/flying:${{ inputs.version_number }}
context: .