Merge pull request #128 from JDIZM/refactor-response-error-handling #130
This file contains hidden or 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: test-and-build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| test-and-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: volta-cli/action@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - run: volta install pnpm | |
| - run: pnpm install | |
| - run: pnpm run lint | |
| - run: pnpm run format:check | |
| - run: pnpm run tsc:check | |
| - run: pnpm run build | |
| - run: pnpm run test | |
| # Run database migrations for development environment | |
| migrate-dev: | |
| needs: test-and-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: volta-cli/action@v4 | |
| with: | |
| node-version: 22 | |
| - run: volta install pnpm | |
| - run: pnpm install | |
| - name: Run database migrations | |
| env: | |
| DATABASE_URL: ${{ secrets.DEV_DATABASE_URL }} | |
| run: pnpm migrate | |
| # TODO uncomment the deployment step when you have configured the secrets. | |
| # deploy-dev: | |
| # needs: [test-and-build, migrate-dev] | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - uses: volta-cli/action@v3 | |
| # with: | |
| # node-version: 20 | |
| # - name: Install doctl | |
| # uses: digitalocean/action-doctl@v2 | |
| # with: | |
| # token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
| # - name: Build container image | |
| # run: docker build -t ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:$(echo $GITHUB_SHA | head -c7) . | |
| # - name: Log in to DigitalOcean Container Registry with short-lived credentials | |
| # run: doctl registry login --expiry-seconds 1200 | |
| # - name: tag image with latest tag | |
| # run: docker tag ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:$(echo $GITHUB_SHA | head -c7) ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:latest | |
| # - name: Push image to DigitalOcean Container Registry | |
| # run: docker push ${{ secrets.REGISTRY_NAME }}/${{secrets.IMAGE_NAME}}-dev:latest |