new config
This commit is contained in:
@@ -1,70 +0,0 @@
|
||||
# Template
|
||||
name: Deployment Verification
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# https://github.com/docker/setup-qemu-action#usage
|
||||
- name: Set up QEMU
|
||||
uses: docker/[email protected]
|
||||
|
||||
# https://github.com/marketplace/actions/docker-setup-buildx
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/[email protected]
|
||||
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
|
||||
#
|
||||
- name: Create necessary Docker networks
|
||||
run: |
|
||||
docker network create back_network_gitea || true
|
||||
docker network create traefik_front_network || true
|
||||
|
||||
- name: Start up services using Docker Compose
|
||||
run: docker compose -f docker-compose.yml up -d
|
||||
|
||||
# - name: Modify /etc/hosts for internal routing
|
||||
# run: |
|
||||
# echo "127.0.0.1 gitea.tips-of-mine.com" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Print Docker Compose services status
|
||||
run: docker ps
|
||||
|
||||
- name: Wait for the application to be ready via Traefik
|
||||
run: |
|
||||
echo "Checking the routing and availability of application via Traefik..."
|
||||
timeout 5m bash -c 'while ! curl -fsSLk "https://gitea.tips-of-mine.com"; do echo "Waiting for the application to be ready..."; sleep 10; done'
|
||||
|
||||
- name: Inspect Network Configuration
|
||||
run: |
|
||||
docker network inspect back_network_gitea
|
||||
docker network inspect traefik_front_network
|
||||
|
||||
- name: Shutdown Docker Compose services
|
||||
if: always()
|
||||
run: docker compose -f docker-compose.yml down
|
||||
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: |
|
||||
docker compose --profile setup down
|
||||
rm -rf /workspace/tips-of-mine/gitea/*
|
||||
@@ -1,51 +0,0 @@
|
||||
# Template
|
||||
name: Deployment Verification
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Create necessary Docker networks
|
||||
run: |
|
||||
docker network create back_network_{ vars.APPLICATION_NAME } || true
|
||||
docker network create traefik_front_network || true
|
||||
|
||||
- name: Start up services using Docker Compose
|
||||
run: docker compose -f docker-compose.yml up -d
|
||||
|
||||
# - name: Modify /etc/hosts for internal routing
|
||||
# run: |
|
||||
# echo "127.0.0.1 { vars.APPLICATION_URL }" | sudo tee -a /etc/hosts
|
||||
# echo "127.0.0.1 dashboard.tips-of-mine.com" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Print Docker Compose services status
|
||||
run: docker ps
|
||||
|
||||
- name: Wait for the application to be ready via Traefik
|
||||
run: |
|
||||
echo "Checking the routing and availability of application via Traefik..."
|
||||
timeout 5m bash -c 'while ! curl -fsSLk "https://{ vars.APPLICATION_URL }"; do echo "Waiting for the application to be ready..."; sleep 10; done'
|
||||
|
||||
- name: Inspect Network Configuration
|
||||
run: |
|
||||
docker network inspect back_network_{ vars.APPLICATION_NAME }
|
||||
docker network inspect traefik_front_network
|
||||
|
||||
- name: Shutdown Docker Compose services
|
||||
if: always()
|
||||
run: docker compose -f docker-compose.yml down
|
||||
@@ -0,0 +1,63 @@
|
||||
# Template — vérification isolée d'une stack Docker Compose.
|
||||
# À copier tel quel dans chaque dépôt, avec .gitea/scripts/ ; aucune variable à configurer.
|
||||
# Remplace ci-develop.yml et ci-main.yml : les supprimer du dépôt.
|
||||
name: Compose CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- main
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CI_SCRIPT: .gitea/scripts/compose-ci.sh
|
||||
HELPER_IMAGE: python:3.13-alpine3.22
|
||||
SHELLCHECK_IMAGE: koalaman/shellcheck:v0.10.0
|
||||
|
||||
jobs:
|
||||
lint-ci-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: ShellCheck du script de CI
|
||||
run: docker run --rm -i --network none "$SHELLCHECK_IMAGE" - < "$CI_SCRIPT"
|
||||
|
||||
- name: Syntaxe du script de réécriture
|
||||
run: >-
|
||||
docker run --rm -i --network none "$HELPER_IMAGE"
|
||||
python3 -c "import ast, sys; ast.parse(sys.stdin.read())"
|
||||
< .gitea/scripts/compose-ci-rewrite.py
|
||||
|
||||
compose-verify:
|
||||
needs: lint-ci-scripts
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Préparer une configuration isolée
|
||||
run: bash "$CI_SCRIPT" prepare
|
||||
|
||||
- name: Démarrer la stack de CI
|
||||
run: bash "$CI_SCRIPT" up
|
||||
|
||||
- name: Vérifier l'état des conteneurs
|
||||
run: bash "$CI_SCRIPT" verify
|
||||
|
||||
- name: Journaux (en cas d'échec)
|
||||
if: failure()
|
||||
run: bash "$CI_SCRIPT" logs
|
||||
|
||||
- name: Nettoyer la stack de CI
|
||||
if: always()
|
||||
run: bash "$CI_SCRIPT" cleanup
|
||||
Reference in New Issue
Block a user