Files
noahspan-flying/.gitea/workflows/build_and_test.yaml
noahspannbauer 03c4dacd99
Some checks failed
Pull Request / changes (pull_request) Successful in 23s
Pull Request / build-and-test (pull_request) Failing after 20s
adding infisical action to workflows
2026-07-13 09:15:51 -05:00

84 lines
2.2 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: actions/checkout@v4
with:
sparse-checkout: |
api
client
- name: Get Secrets from Infisical
uses: Infisical/secrets-action@v1.0.16
with:
domain: http://infisical
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
project-slug: noahspan-j227
env-slug: ${{ inputs.environment_name }}
secret-path: /flying
- name: Install Nest CLI
run: |
npm install -g @nestjs/cli
- name: 'Setup Node'
uses: actions/setup-node@v4
with:
node-version: ${{ env.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: ${{ env.VITE_API_URL }}
VITE_BASE_URL: ${{ env.VITE_BASE_URL }}
VITE_CLIENT_ID: ${{ env.VITE_CLIENT_ID }}
VITE_ISSUER_URI: ${{ env.VITE_ISSUER_URI }}
VITE_TENANT_ID: ${{ env.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: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.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: .