82 lines
2.3 KiB
YAML
82 lines
2.3 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container: oven/bun:1
|
|
steps:
|
|
- name: Install git and node
|
|
run: apt-get update && apt-get install -y git nodejs
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: bun install --frozen-lockfile
|
|
|
|
- name: Audit dependencies
|
|
run: bun audit
|
|
|
|
- name: Run unit tests
|
|
run: bun run test:unit run
|
|
|
|
- name: Type check
|
|
run: bun run type-check -- --force
|
|
|
|
- name: Build
|
|
run: bun run build-only
|
|
|
|
- name: Upload dist
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
|
|
publish:
|
|
needs: build
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-latest
|
|
container: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Debug docker socket
|
|
run: |
|
|
id
|
|
ls -la /var/run/ || true
|
|
ls -la /var/run/docker.sock || true
|
|
which docker || true
|
|
docker version || true
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download dist
|
|
uses: https://code.forgejo.org/forgejo/download-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.mcpeakdev.com
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Extract image tag
|
|
id: meta
|
|
run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
git.mcpeakdev.com/mcpeakml/portfolio:${{ steps.meta.outputs.tag }}
|
|
git.mcpeakdev.com/mcpeakml/portfolio:latest
|