Skip to content

Build and Deploy to Testing #1480

Build and Deploy to Testing

Build and Deploy to Testing #1480

name: Build and Deploy to Testing
on:
schedule:
# Run every hour
- cron: '0 * * * *'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: Build
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: develop
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Clients image
uses: docker/build-push-action@v7
with:
context: .
file: ./Clients/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/verifywise-frontend:test
no-cache: true
build-args: |
VITE_SLACK_CLIENT_ID=${{ secrets.SLACK_CLIENT_ID }}
VITE_APP_VERSION=develop
- name: Copy version.json into Servers context
run: cp version.json Servers/version.json
- name: Build and push Servers image
uses: docker/build-push-action@v7
with:
context: ./Servers
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/verifywise-backend:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push EvalServer image
uses: docker/build-push-action@v7
with:
context: .
file: ./EvalServer/Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/verifywise-eval-server:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push AIGateway image
uses: docker/build-push-action@v7
with:
context: ./AIGateway
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/verifywise-ai-gateway:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to Testing
uses: appleboy/ssh-action@v1.2.5
with:
host: ${{ secrets.TEST_HOST }}
username: ${{ secrets.TEST_USER }}
key: ${{ secrets.TEST_SSH_KEY }}
script: |
cd /root/verifywise/_saas_deployment
docker-compose --env-file .env.prod down
docker images --format "table {{.Repository}}:{{.Tag}}\t{{.ID}}" | grep -v -E "(redis|postgres|admin)" | awk 'NR>1 {print $2}' | xargs -r docker rmi -f || true
./install.sh