From a62fb53b3584b1e351bfcf5dd8d90aef561e18a4 Mon Sep 17 00:00:00 2001 From: xMikux <26039249+xMikux@users.noreply.github.com> Date: Fri, 13 Sep 2024 08:50:58 +0800 Subject: [PATCH] test: add health check --- .github/compose/docker-compose.yml | 14 +++++--- .github/workflows/resuable_ia.yml | 56 ++++++++++++++++++++---------- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/.github/compose/docker-compose.yml b/.github/compose/docker-compose.yml index b61b4589..e4d8d6a0 100644 --- a/.github/compose/docker-compose.yml +++ b/.github/compose/docker-compose.yml @@ -1,12 +1,18 @@ -version: "3" - services: - builder: - image: ghcr.io/xmikux/itemsadder:latest + server: + container_name: itemsadder_server + image: ghcr.io/xmikux/itemsadder-image:latest volumes: + # - type: bind + # source: ${PWD}/external + # target: /app/external - type: bind source: ${PWD}/Resourcepack/contents target: /app/plugins/ItemsAdder/contents - type: bind source: ${PWD}/output target: /app/plugins/ItemsAdder/output + ports: + - 25575:25575 + environment: + - RCON_ENV \ No newline at end of file diff --git a/.github/workflows/resuable_ia.yml b/.github/workflows/resuable_ia.yml index 18ce2118..73553715 100644 --- a/.github/workflows/resuable_ia.yml +++ b/.github/workflows/resuable_ia.yml @@ -1,28 +1,48 @@ name: Makeup IA Resourcepack on: - workflow_call: {} + workflow_call: + secrets: + S3_ACCESS_KEY: + required: true + S3_SECRET_KEY: + required: true + S3_BUCKET_NAME: + required: true jobs: - ia_container: + ia_resourcepack: + name: Generate IA Resourcepack runs-on: ubuntu-latest - container: - image: ghcr.io/xmikux/itemsadder-image:latest - env: - RCON_ENV: ${{ secrets.RCON_PASSWORD }} - ports: - - 25575:25575 - steps: - - name: Check for dockerenv file - run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) - - name: Checkout repo + steps: + - name: Checkout Repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Check container + # - name: Setup - S3cmd Cli Tool + # uses: s3-actions/s3cmd@v1.7.0 + # with: + # provider: "vultr" + # region: "sgp1" + # access_key: ${{ secrets.S3_ACCESS_KEY }} + # secret_key: ${{ secrets.S3_SECRET_KEY }} + + # - name: S3 - Download Plugins + # run: | + # s3cmd get s3://${{ secrets.S3_BUCKET_NAME }}/itemsaddres maps-cache-data.tar.xz + + - name: Setup - IA Minecraft Server run: | - ls -alh - pwd - ls -alh - docker -h - wget -h + mkdir output + docker compose -f .github/compose/docker-compose.yml up + env: + RCON_ENV: ${{ secrets.RCON_PASSWORD }} + + - name: Check services healthiness + uses: thegabriele97/dockercompose-health-action@main + with: + filename: ".github/compose/docker-compose.yml" + timeout: "60" + workdir: ".github/compose"