Skip to content

feat: implement comprehensive test framework and infrastructure #1

feat: implement comprehensive test framework and infrastructure

feat: implement comprehensive test framework and infrastructure #1

Workflow file for this run

# Cuisine Code CI/CD Workflow
# Copyright (c) 2025 Aidan Pace
name: Cuisine Code CI/CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up FreeBSD environment
uses: vmactions/freebsd-vm@v1
with:
release: '14.0'
usesh: true
prepare: |
pkg update
pkg install -y guile3 gmake git
- name: Install dependencies
run: gmake deps
- name: Run tests
run: gmake test
build:
name: Build
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up FreeBSD environment
uses: vmactions/freebsd-vm@v1
with:
release: '14.0'
usesh: true
prepare: |
pkg update
pkg install -y guile3 emscripten node npm gmake git
- name: Build project
run: gmake all
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: cuisine-code-build
path: |
web/
c-output/
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: cuisine-code-build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}/api:latest
ghcr.io/${{ github.repository }}/web:latest
platforms: linux/amd64,linux/arm64
- name: Deploy to Production
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
script: |
cd /opt/cuisine-code
docker-compose pull
docker-compose up -d