diff --git a/.gitea/workflows/ci-develop.yml b/.gitea/workflows/ci-develop.yml index ff3e5d9..99b1b5e 100644 --- a/.gitea/workflows/ci-develop.yml +++ b/.gitea/workflows/ci-develop.yml @@ -1,33 +1,24 @@ # Template name: Deployment Verification -run-name: Build & Deploy ${{ gitea.ref }} on ${{ gitea.actor }} on: push: branches: - develop - tags: - - "v[0-9]+.[0-9]+.[0-9]+" + tags: + - "v[0-9]+.[0-9]+.[0-9]" pull_request: - types: - - opened - - synchronize - - reopened branches: - - develop - main jobs: - test And Deploy: + deploy-and-test: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -41,7 +32,8 @@ jobs: # - name: Modify /etc/hosts for internal routing # run: | -# echo "127.0.0.1 metabase metabase.tips-of-mine.local" | sudo tee -a /etc/hosts +# echo "127.0.0.1 gitea.tips-of-mine.com" | 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 @@ -64,4 +56,4 @@ jobs: if: always() run: | docker compose --profile setup down - rm -rf /workspace/tips-of-mine/metabase/* + rm -rf /workspace/tips-of-mine/metabase/* \ No newline at end of file diff --git a/.gitea/workflows/ci-main.yml b/.gitea/workflows/ci-main.yml new file mode 100644 index 0000000..a5a8b5e --- /dev/null +++ b/.gitea/workflows/ci-main.yml @@ -0,0 +1,53 @@ +# Template +name: Deployment Verification + +on: + push: + branches: + - main + tags: + - "v[0-9]+.[0-9]+.[0-9]"s + 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 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 432638e..90b2486 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -75,4 +75,32 @@ services: interval: 10s timeout: 5s retries: 3 - start_period: 60s \ No newline at end of file + start_period: 60s + +### + msmtpd: + container_name: metabase-msmtpd + hostname: metabase-msmtpd + image: crazymax/msmtpd:latest + networks: + - back_network_metabase + environment: + - "TZ=Europe/Paris" + - "PUID=1500" + - "PGID=1500" + - "SMTP_HOST=10.0.4.52" + - "SMTP_PORT=587" + - "SMTP_TLS=on" + - "SMTP_STARTTLS=on" + - "SMTP_TLS_CHECKCERT=off" + - "SMTP_AUTH=on" + - "SMTP_USER=hostinfo@tips-of-mine.fr" + - "SMTP_PASSWORD=P@ssword!Here!123456" + - "SMTP_DOMAIN=localhost" + - "SMTP_FROM=hostinfo@tips-of-mine.fr" + restart: always + healthcheck: + test: ["CMD-SHELL", "echo EHLO localhost"] + interval: 5s + timeout: 5s + retries: 5 \ No newline at end of file