add autodeploy workflow action

This commit is contained in:
Julien Aldon
2026-01-19 14:44:00 +01:00
parent 68b7405c52
commit 23cf55eb61
3 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
name: Deploy Fefan
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build & deploy
run: |
git pull
docker compose up -d --build

15
README.md Normal file
View File

@@ -0,0 +1,15 @@
## Installation
### Setup environment variables
```sh
NEXT_PUBLIC_CONTENT_URI=https://content.fefan.fr/api
NEXT_PUBLIC_IMG_URI=https://content.fefan.fr
NEXT_PUBLIC_ORIGIN=https://fefan.fr
POSTGRES_USER=strapi
POSTGRES_PASSWORD=<db-pass>
```
### Run project
```sh
docker-compose up --build -d
```

61
docker-compose.yml Normal file
View File

@@ -0,0 +1,61 @@
services:
strapi:
restart: always
build: ./strapi
expose:
- 1337
ports:
- 1337:1337
environment:
NODE_ENV: production
DATABASE_CLIENT: postgres
DATABASE_HOST: db
hostname: content.fefan.fr
depends_on:
- db
networks:
fefan:
aliases:
- fefan-backend
volumes:
- strapi-data:/app
next:
restart: always
build:
context: ./next
expose:
- 3000
ports:
- 3000:3000
environment:
NEXT_PUBLIC_CONTENT_URI: ${NEXT_PUBLIC_IMG_URI}
NEXT_PUBLIC_IMG_URI: ${NEXT_PUBLIC_IMG_URI}
NEXT_PUBLIC_ORIGIN: ${NEXT_PUBLIC_ORIGIN}
NEXT_PRIVATE_CONTENT_URI: http://fefan-backend:1337/api
NEXT_PRIVATE_IMG_URI: http://fefan-backend:1337
depends_on:
- strapi
networks:
- fefan
db:
restart: always
image: postgres
expose:
- 5432
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- fefan
volumes:
- db-data:/var/lib/postgresql/18/main
networks:
fefan:
driver: bridge
volumes:
db-data: {}
strapi-data: {}
certbot-data: {}
certbot-config: {}
http-well-known: {}