add autodeploy workflow action
This commit is contained in:
17
.gitea/workflow/deploy.yaml
Normal file
17
.gitea/workflow/deploy.yaml
Normal 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
15
README.md
Normal 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
61
docker-compose.yml
Normal 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: {}
|
||||||
Reference in New Issue
Block a user