From 0ea7e48b90432f7e3db957f0eaeec1a6a4a1e051 Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Sun, 23 Nov 2025 10:43:19 -0600 Subject: [PATCH] updating infrastructure --- .github/workflows/build.yaml | 62 ++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..b27a96d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,62 @@ +name: 'API Build' +on: + workflow_call: + inputs: + environment_name: + required: true + type: string + version_number: + required: true + type: string + +jobs: + build: + runs-on: ubuntu-latest + environment: ${{ inputs.environment_name }} + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + sparse-checkout: | + api + + - 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: Build Client + run: | + 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: . + target: api