build & deploy nestjs-clerk #5
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: 📦 | |
run-name: build & deploy ${{ inputs.project }} | |
on: | |
workflow_dispatch: | |
inputs: | |
project: | |
type: string | |
required: true | |
description: name of project to build (folder name) | |
workflow_call: | |
inputs: | |
project: | |
type: string | |
required: true | |
description: name of project to build (folder name) | |
env: ${{ secrets }} | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Prepare repository | |
uses: ./.github/actions/prepare | |
with: | |
project: ${{ inputs.project }} | |
- name: Run tests | |
working-directory: ${{ inputs.project }} | |
run: npm run test --if-present | |
- name: Try build | |
working-directory: ${{ inputs.project }} | |
run: npm run build --if-present | |
- name: Deploy | |
working-directory: ${{ inputs.project }} | |
run: npm run deploy --if-present |