Skip to content

Project ons initialisation #6

Project ons initialisation

Project ons initialisation #6

Workflow file for this run

name: CI — API
on:
push:
branches: [main]
pull_request:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
typecheck:
name: Type-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3"
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen
- run: bun run typecheck
working-directory: api
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3"
- uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen
- run: bun run test
working-directory: api
docker:
name: Docker build
runs-on: ubuntu-latest
needs: [typecheck, test]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: ./api
file: api/Dockerfile
push: false
cache-from: type=gha,scope=docker-api
cache-to: type=gha,mode=max,scope=docker-api