diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..71efc52 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + workflow_call: + inputs: + tech_stack: + type: string + required: true + build_command: + type: string + required: false + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + # 🟢 NODE / REACT / NESTJS + - name: Setup Node + if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs' + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Build (Node / React / NestJS) + if: inputs.tech_stack == 'node' || inputs.tech_stack == 'react' || inputs.tech_stack == 'nestjs' + run: | + if [ -n "${{ inputs.build_command }}" ]; then + echo "Running custom build command" + ${{ inputs.build_command }} + else + npm install + npm run build || true + fi + \ No newline at end of file