Skip to content

Updated CI/CD Tests

Updated CI/CD Tests #5

Workflow file for this run

name: Deployment
on:
workflow_dispatch:
# Uncomment once we are ready to deploy
#push:
# branches:
# - main
pull_request:
branches:
- main
jobs:
deploy-web:
runs-on: ubuntu-latest
steps:
- name: Checkout workspace
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Debug - List directory structure
run: |
ls -R
- name: Install dependencies and run lint checks
run: |
cd src/website
npm ci
npm run lint
- name: Build website
run: |
cd src/website
npm run build
- name: Update docker image
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
[ ! -d "sailbot_workspace" ] && git clone https://github.com/UBCSailbot/sailbot_workspace.git
cd sailbot_workspace
git pull
touch src/website/.env.local # Adds a local environment file to VM to override env vars in .env.production
echo NEXT_PUBLIC_SERVER_HOST=http://${{ secrets.SSH_HOST }} >> src/website/.env.local
docker compose -f .devcontainer/docker-compose.yml -f .devcontainer/website/docker-compose.website.prod.yml up --force-recreate -d --build --remove-orphans