Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.14
|
|
- run: bun install --frozen-lockfile
|
|
- run: bun run typecheck
|
|
- run: bun test
|
|
- run: bunx playwright install --with-deps chromium
|
|
- run: bunx playwright test
|
|
|
|
image:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
IMAGE: gitea.lucaswinther.info/lucasw89/portfolio-next
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: docker build --build-arg APP_VERSION=${{ github.sha }} -t "$IMAGE:${{ github.sha }}" .
|
|
- run: scripts/smoke-test.sh "$IMAGE:${{ github.sha }}"
|
|
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.lucaswinther.info -u "${{ github.repository_owner }}" --password-stdin
|
|
docker push "$IMAGE:${{ github.sha }}"
|
|
docker tag "$IMAGE:${{ github.sha }}" "$IMAGE:latest"
|
|
docker push "$IMAGE:latest"
|