Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b50cfb5049 | ||
|
|
a5227b9936 | ||
|
|
0d298db797 | ||
|
|
cbe71a1f32 | ||
|
|
a8fa8fd7e0 | ||
|
|
4aa2abd396 |
@@ -20,11 +20,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
-f deploy/docker/Dockerfile.prod \
|
-f deploy/docker/Dockerfile.prod \
|
||||||
-t gitea.malio.fr/malio/lesstime:${{ gitea.ref_name }} \
|
-t gitea.malio.fr/malio-dev/lesstime:${{ gitea.ref_name }} \
|
||||||
-t gitea.malio.fr/malio/lesstime:latest \
|
-t gitea.malio.fr/malio-dev/lesstime:latest \
|
||||||
.
|
.
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Push Docker image
|
||||||
run: |
|
run: |
|
||||||
docker push gitea.malio.fr/malio/lesstime:${{ gitea.ref_name }}
|
docker push gitea.malio.fr/malio-dev/lesstime:${{ gitea.ref_name }}
|
||||||
docker push gitea.malio.fr/malio/lesstime:latest
|
docker push gitea.malio.fr/malio-dev/lesstime:latest
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
parameters:
|
||||||
app.version: '0.3.14'
|
app.version: '0.3.17'
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ COPY config config/
|
|||||||
COPY migrations migrations/
|
COPY migrations migrations/
|
||||||
COPY public public/
|
COPY public public/
|
||||||
COPY src src/
|
COPY src src/
|
||||||
COPY templates templates/
|
|
||||||
|
|
||||||
RUN composer dump-autoload --optimize --no-dev
|
RUN composer dump-autoload --optimize --no-dev
|
||||||
|
|
||||||
|
|||||||
@@ -9,20 +9,20 @@ export LESSTIME_IMAGE_TAG="$TAG"
|
|||||||
echo "==> Deploying lesstime:${TAG}..."
|
echo "==> Deploying lesstime:${TAG}..."
|
||||||
|
|
||||||
echo "==> Pulling image..."
|
echo "==> Pulling image..."
|
||||||
docker compose pull
|
sudo docker compose pull
|
||||||
|
|
||||||
echo "==> Starting container..."
|
echo "==> Starting container..."
|
||||||
docker compose up -d
|
sudo docker compose up -d
|
||||||
|
|
||||||
echo "==> Waiting for container to be ready..."
|
echo "==> Waiting for container to be ready..."
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "==> Running migrations..."
|
echo "==> Running migrations..."
|
||||||
docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
sudo docker compose exec -T -u www-data app php bin/console doctrine:migrations:migrate --no-interaction
|
||||||
|
|
||||||
echo "==> Clearing cache..."
|
echo "==> Clearing cache..."
|
||||||
docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
sudo docker compose exec -T -u www-data app php bin/console cache:clear --env=prod
|
||||||
docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
sudo docker compose exec -T -u www-data app php bin/console cache:warmup --env=prod
|
||||||
|
|
||||||
VERSION=$(docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
VERSION=$(sudo docker compose exec -T app cat config/version.yaml | grep 'app.version' | awk -F"'" '{print $2}')
|
||||||
echo "==> Deployed v${VERSION}"
|
echo "==> Deployed v${VERSION}"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: gitea.malio.fr/malio/lesstime:${LESSTIME_IMAGE_TAG:-latest}
|
image: gitea.malio.fr/malio-dev/lesstime:${LESSTIME_IMAGE_TAG:-latest}
|
||||||
container_name: lesstime-app
|
container_name: lesstime-app
|
||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "8081:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/jwt:/var/www/html/config/jwt:ro
|
- ./config/jwt:/var/www/html/config/jwt:ro
|
||||||
- ./uploads:/var/www/html/var/uploads
|
- ./uploads:/var/www/html/var/uploads
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Creer `docker-compose.yml` :
|
|||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: gitea.malio.fr/malio/lesstime:${LESSTIME_IMAGE_TAG:-latest}
|
image: gitea.malio.fr/malio-dev/lesstime:${LESSTIME_IMAGE_TAG:-latest}
|
||||||
container_name: lesstime-app
|
container_name: lesstime-app
|
||||||
env_file: .env
|
env_file: .env
|
||||||
ports:
|
ports:
|
||||||
@@ -292,7 +292,7 @@ docker compose exec -T -u www-data app php bin/console doctrine:migrations:migra
|
|||||||
|
|
||||||
Le workflow `.gitea/workflows/build-docker.yml` se declenche automatiquement sur push de tag `v*` :
|
Le workflow `.gitea/workflows/build-docker.yml` se declenche automatiquement sur push de tag `v*` :
|
||||||
1. Build l'image multi-stage
|
1. Build l'image multi-stage
|
||||||
2. Push vers `gitea.malio.fr/malio/lesstime:<tag>` et `:latest`
|
2. Push vers `gitea.malio.fr/malio-dev/lesstime:<tag>` et `:latest`
|
||||||
|
|
||||||
Combine avec `auto-tag-develop.yml`, chaque push sur `develop` cree automatiquement un tag → build → image disponible.
|
Combine avec `auto-tag-develop.yml`, chaque push sur `develop` cree automatiquement un tag → build → image disponible.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user