31 lines
751 B
YAML
31 lines
751 B
YAML
name: Build and Deploy
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build Docker Image
|
|
run: |
|
|
docker build -t chesco-site:latest -f docker/Dockerfile .
|
|
|
|
- name: Sync to Host Directory
|
|
run: |
|
|
# Create the directory if it doesn't exist
|
|
mkdir -p ~/chesco
|
|
|
|
# Copy the compose file to the host directory
|
|
cp docker/docker-compose.yaml ~/chesco/docker-compose.yaml
|
|
|
|
- name: Deploy with Compose
|
|
run: |
|
|
# Move into the dedicated directory and restart the service
|
|
cd ~/chesco
|
|
docker compose up -d --force-recreate
|