Portfolio/.forgejo/workflows/ci.yml
Matthew L McPeak 6fd8a5b4fa
Some checks failed
ci / build (pull_request) Failing after 0s
ci / publish (pull_request) Has been skipped
fix: CI
Fix yaml error
2026-06-12 10:24:14 -04:00

74 lines
2.1 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: portfolio${{ "-" + steps.meta.outputs.tag }}.zip
path: dist
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- 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