30 lines
689 B
YAML
30 lines
689 B
YAML
name: Build and Deploy Fitness App
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
volumes:
|
|
- /opt/fitness:/opt/fitness
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build Backend Image
|
|
run: |
|
|
docker build -f apps/api/Dockerfile -t fitness-api:latest .
|
|
|
|
- name: Build Frontend Image
|
|
run: |
|
|
docker build -f apps/web/Dockerfile -t fitness-web:latest .
|
|
|
|
- name: Restart Application
|
|
run: |
|
|
cd /opt/fitness
|
|
docker compose down
|
|
docker compose up -d |