Skip to content

add docker and also refine magicalauth #1

add docker and also refine magicalauth

add docker and also refine magicalauth #1

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Node.js dependencies
run: npm ci
- name: Run frontend tests
run: npm test
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Frontend
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}/frontend:latest
ghcr.io/${{ github.repository }}/frontend:${{ github.sha }}
build-args: |
NEXT_PUBLIC_AGIXT_URL=http://agixt:7437
NEXT_PUBLIC_APP_URL=http://localhost:3000
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Create .env file
run: |
echo "NEXT_PUBLIC_AGIXT_URL=http://agixt:7437" >> .env
echo "NEXT_PUBLIC_APP_URL=http://localhost:3000" >> .env
- name: Deploy with Docker Compose
run: |
# Create AGiXT network if it doesn't exist
docker network create agixt_default || true
# Pull and start the frontend
docker-compose pull
docker-compose up -d