From 6abee7cb51bda84fc0b531d26287485fa8e9c3cd Mon Sep 17 00:00:00 2001 From: zardzul Date: Fri, 13 Feb 2026 10:43:32 +0100 Subject: [PATCH] fix docker image building --- .gitea/workflows/production.yml | 36 ++++++---------- .gitea/workflows/publish.yml | 42 +++++++++++++------ Dockerfile | 8 ++-- .../docker-compose.yml | 2 +- data/.cache/curseforge/cache-index.json | 1 - .../14ef06dc-1a65-4611-87d6-c61eea6c8b00.json | 1 - .../3fa6caf4-40e9-4b41-91b0-6d44997753b0.json | 1 - 7 files changed, 46 insertions(+), 45 deletions(-) rename {compose-test => compose-file}/docker-compose.yml (72%) delete mode 100644 data/.cache/curseforge/cache-index.json delete mode 100644 data/.cache/curseforge/getModFileInfo/14ef06dc-1a65-4611-87d6-c61eea6c8b00.json delete mode 100644 data/.cache/curseforge/searchModWithGameIdSlugClassId/3fa6caf4-40e9-4b41-91b0-6d44997753b0.json diff --git a/.gitea/workflows/production.yml b/.gitea/workflows/production.yml index 2044cf0..62b8670 100644 --- a/.gitea/workflows/production.yml +++ b/.gitea/workflows/production.yml @@ -11,36 +11,24 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - with: - ref: main - path: . - - name: Transfer files - uses: burnett01/rsync-deployments@8.0.4 + - name: Copy docker-compose.yml to server + uses: appleboy/scp-action@v0.1.7 with: - switches: -azvr --delete --exclude=".gitignore" --exclude=".git" --exclude=".gitea" --exclude="data" --exclude=".env" - path: . - remote_path: /home/${{ secrets.USERNAME }}/minecraft-server-ironveil - remote_host: ${{ secrets.HOST }} - remote_user: ${{ secrets.USERNAME }} - remote_key: ${{ secrets.KEY }} + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + source: "compose-file/docker-compose.yml" + target: "/home/${{ secrets.USERNAME }}/minecraft-server-ironveil" + strip_components: 1 - - name: Stop container + - name: Deploy and restart container uses: appleboy/ssh-action@v1.2.5 with: - host: ${{ secrets.host }} + host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} key: ${{ secrets.KEY }} script: | cd minecraft-server-ironveil - docker compose down - - - name: Start container - uses: appleboy/ssh-action@v1.2.5 - with: - host: ${{ secrets.host }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - script: | - cd minecraft-server-ironveil - docker compose up -d + docker compose pull + docker compose up -d --force-recreate diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 1645a12..dc1d4fa 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -2,29 +2,45 @@ name: Build and Publish Docker Image on: push: - tags: - - v[0-9]+.[0-9]+.[0-9]+ - + branches: + - main + jobs: - build-and-push: + build: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Log in to git.cashew.network registry + + - name: Log in to Docker Registry uses: docker/login-action@v3 with: - registry: git.cashew.network - username: ${{ secrets.GIT_USERNAME }} - password: ${{ secrets.GIT_PASSWORD }} - - - name: Build and push image + registry: ${{ secrets.GIT_HOST }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.GIT_HOST }}/${{ github.repository }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest + + - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . push: true - tags: ${{ secrets.GIT_USERNAME }}/ironveil:${{ github.ref_name }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=registry,ref=${{ secrets.GIT_HOST }}/${{ github.repository }}:buildcache + cache-to: type=registry,ref=${{ secrets.GIT_HOST }}/${{ github.repository }}:buildcache,mode=max + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3ab24c7..7b91988 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,11 @@ FROM eclipse-temurin:17-jdk # Set working directory WORKDIR /server -# Copy server configuration files -COPY configuration/. . +# Copy modpack files +COPY modpack/ /server/ -# Copy all modpack related files -COPY modpack/. . +# Copy configuration files +COPY configuration/ /server/ # Make run.sh executable RUN chmod +x run.sh diff --git a/compose-test/docker-compose.yml b/compose-file/docker-compose.yml similarity index 72% rename from compose-test/docker-compose.yml rename to compose-file/docker-compose.yml index 4b4da58..a10971d 100644 --- a/compose-test/docker-compose.yml +++ b/compose-file/docker-compose.yml @@ -1,6 +1,6 @@ services: ironveil: - image: ironveil:latest + image: ${{ secrets.GIT_HOST }}/${{ github.repository }}:latest container_name: ironveil volumes: - ./world:/server/world diff --git a/data/.cache/curseforge/cache-index.json b/data/.cache/curseforge/cache-index.json deleted file mode 100644 index e80b142..0000000 --- a/data/.cache/curseforge/cache-index.json +++ /dev/null @@ -1 +0,0 @@ -{"operations":{"getModFileInfo":{"1250591,7575878":{"filename":"14ef06dc-1a65-4611-87d6-c61eea6c8b00.json","expiresAt":"2026-02-12T19:47:13.246183510Z"}},"searchModWithGameIdSlugClassId":{"432,over-stars,4471":{"filename":"3fa6caf4-40e9-4b41-91b0-6d44997753b0.json","expiresAt":"2026-02-10T20:47:13.225100126Z"}}}} \ No newline at end of file diff --git a/data/.cache/curseforge/getModFileInfo/14ef06dc-1a65-4611-87d6-c61eea6c8b00.json b/data/.cache/curseforge/getModFileInfo/14ef06dc-1a65-4611-87d6-c61eea6c8b00.json deleted file mode 100644 index 29b205b..0000000 --- a/data/.cache/curseforge/getModFileInfo/14ef06dc-1a65-4611-87d6-c61eea6c8b00.json +++ /dev/null @@ -1 +0,0 @@ -{"gameId":432,"fileName":"OS Serverpack v5.5.zip","gameVersions":["1.20.1","Forge"],"displayName":"OS Serverpack v5.5","sortableGameVersions":[{"gameVersionPadded":"0000000001.0000000020.0000000001","gameVersion":"1.20.1","gameVersionReleaseDate":"2023-06-12T14:26:38.477Z","gameVersionName":"1.20.1","gameVersionTypeId":75125},{"gameVersionPadded":"0","gameVersion":"","gameVersionReleaseDate":"2022-10-01T00:00:00Z","gameVersionName":"Forge","gameVersionTypeId":68441}],"downloadUrl":"https://edge.forgecdn.net/files/7575/878/OS%20Serverpack%20v5.5.zip","fileDate":"2026-02-04T16:40:45.800Z","exposeAsAlternative":null,"modId":1250591,"modules":[{"name":"mods","fingerprint":491038856},{"name":"scripts","fingerprint":2316932191},{"name":"run.bat","fingerprint":4191847801},{"name":"run.sh","fingerprint":3076618596},{"name":"user_jvm_args.txt","fingerprint":1298710358},{"name":"config","fingerprint":733434366},{"name":"global_packs","fingerprint":738911182},{"name":"kubejs","fingerprint":2552288896},{"name":"libraries","fingerprint":2766827340}],"dependencies":[],"fileFingerprint":2501413001,"releaseType":1,"hashes":[{"value":"718e65a9d3e5c2388ca899589f9b857537c68f3a","algo":1},{"value":"11e309d6a626309c3b5f279bc2f987f8","algo":2}],"parentProjectFileId":7566405,"alternateFileId":0,"id":7575878,"fileLength":792979618,"downloadCount":1,"serverPackFileId":null,"serverPack":false,"available":false} \ No newline at end of file diff --git a/data/.cache/curseforge/searchModWithGameIdSlugClassId/3fa6caf4-40e9-4b41-91b0-6d44997753b0.json b/data/.cache/curseforge/searchModWithGameIdSlugClassId/3fa6caf4-40e9-4b41-91b0-6d44997753b0.json deleted file mode 100644 index b6c6612..0000000 --- a/data/.cache/curseforge/searchModWithGameIdSlugClassId/3fa6caf4-40e9-4b41-91b0-6d44997753b0.json +++ /dev/null @@ -1 +0,0 @@ -{"allowModDistribution":true,"screenshots":[{"description":"","id":1331753,"title":"Mossy Village Sunrise","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/753/2025-04-26_12-09-01-jpg.jpg","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/753/310/172/2025-04-26_12-09-01-jpg.jpg"},{"description":"","id":1331744,"title":"Village","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/744/2024-09-18_21-47-01-jpg.jpg","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/744/310/172/2024-09-18_21-47-01-jpg.jpg"},{"description":"","id":1331752,"title":"Remote Cabin Structure","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/752/2025-04-25_20-38-12-jpg.jpg","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/752/310/172/2025-04-25_20-38-12-jpg.jpg"},{"description":"","id":1331740,"title":"Quest Book","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/740/2025-04-09_16-42-51-png.png","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/740/310/172/2025-04-09_16-42-51-png.png"},{"description":"","id":1331750,"title":"Void Dimension","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/750/2025-04-18_18-24-59-jpg.jpg","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/750/310/172/2025-04-18_18-24-59-jpg.jpg"},{"description":"","id":1331751,"title":"Pirate Village","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/751/2025-04-25_20-41-16-jpg.jpg","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/751/310/172/2025-04-25_20-41-16-jpg.jpg"},{"description":"","id":1331745,"title":"Beautiful Terrain","modId":1250591,"url":"https://media.forgecdn.net/attachments/1331/745/2024-06-30_14-44-25-jpg.jpg","thumbnailUrl":"https://media.forgecdn.net/attachments/thumbnails/1331/745/310/172/2024-06-30_14-44-25-jpg.jpg"}],"classId":4471,"latestFilesIndexes":[{"filename":"Over Stars-v5.5.zip","releaseType":1,"gameVersion":"1.20.1","gameVersionTypeId":75125,"modLoader":1,"fileId":7566405}],"dateCreated":"2025-04-24T12:50:30.137Z","logo":{"description":"","id":1384614,"title":"638897969899353302.gif","modId":1250591,"url":"https://media.forgecdn.net/avatars/1384/614/638897969899353302.gif","thumbnailUrl":"https://media.forgecdn.net/avatars/thumbnails/1384/614/256/256/638897969899353302_animated.gif"},"links":{"sourceUrl":null,"issuesUrl":null,"websiteUrl":"https://www.curseforge.com/minecraft/modpacks/over-stars","wikiUrl":null},"dateReleased":"2026-02-04T16:40:45.8Z","id":1250591,"categories":[{"gameId":432,"classId":4471,"name":"Adventure and RPG","dateModified":"2015-02-16T15:58:24.98Z","parentCategoryId":4471,"id":4475,"iconUrl":"https://media.forgecdn.net/avatars/14/480/635596775049811800.png","slug":"adventure-and-rpg","url":"https://www.curseforge.com/minecraft/modpacks/adventure-and-rpg","displayIndex":0,"class":false},{"gameId":432,"classId":4471,"name":"Magic","dateModified":"2015-02-16T15:34:17.873Z","parentCategoryId":4471,"id":4473,"iconUrl":"https://media.forgecdn.net/avatars/14/474/635596760578719019.png","slug":"magic","url":"https://www.curseforge.com/minecraft/modpacks/magic","displayIndex":0,"class":false},{"gameId":432,"classId":4471,"name":"Tech","dateModified":"2015-02-16T15:35:53.467Z","parentCategoryId":4471,"id":4472,"iconUrl":"https://media.forgecdn.net/avatars/14/479/635596761534662757.png","slug":"tech","url":"https://www.curseforge.com/minecraft/modpacks/tech","displayIndex":0,"class":false},{"gameId":432,"classId":4471,"name":"Quests","dateModified":"2015-02-16T17:06:53.797Z","parentCategoryId":4471,"id":4478,"iconUrl":"https://media.forgecdn.net/avatars/14/487/635596816137981263.png","slug":"quests","url":"https://www.curseforge.com/minecraft/modpacks/quests","displayIndex":0,"class":false},{"gameId":432,"classId":4471,"name":"Combat / PvP","dateModified":"2015-02-10T21:12:37.56Z","parentCategoryId":4471,"id":4483,"iconUrl":"https://media.forgecdn.net/avatars/14/313/635591779575605594.png","slug":"combat-pvp","url":"https://www.curseforge.com/minecraft/modpacks/combat-pvp","displayIndex":0,"class":false}],"slug":"over-stars","gameId":432,"summary":"Challenging Tech-RPG Progression Pack, Unique Quests & Storyline, Tech Ages, Ferocious Bosses, Detailed Worlds, Limitless Adventures","latestFiles":[{"gameId":432,"fileName":"Over Stars-v5.5.zip","gameVersions":["1.20.1","Forge"],"displayName":"Over Stars-v5.5","sortableGameVersions":[{"gameVersionPadded":"0000000001.0000000020.0000000001","gameVersion":"1.20.1","gameVersionReleaseDate":"2023-06-12T14:26:38.477Z","gameVersionName":"1.20.1","gameVersionTypeId":75125},{"gameVersionPadded":"0","gameVersion":"","gameVersionReleaseDate":"2022-10-01T00:00:00Z","gameVersionName":"Forge","gameVersionTypeId":68441}],"downloadUrl":"https://edge.forgecdn.net/files/7566/405/Over%20Stars-v5.5.zip","fileDate":"2026-02-02T15:06:59.200Z","exposeAsAlternative":null,"modId":1250591,"modules":[{"name":"manifest.json","fingerprint":657962886},{"name":"modlist.html","fingerprint":1635060266},{"name":"overrides","fingerprint":628719641}],"dependencies":[],"fileFingerprint":1274657669,"releaseType":1,"hashes":[{"value":"35b076fa0c2fe99e1b5e83dd6239ba0f3d2ba52f","algo":1},{"value":"7a61b9a804b7514f94c13d9445b428b7","algo":2}],"parentProjectFileId":null,"alternateFileId":0,"id":7566405,"fileLength":79460179,"downloadCount":3528,"serverPackFileId":7575878,"serverPack":false,"available":false}],"dateModified":"2026-02-05T07:41:11.74Z","gamePopularityRank":6271,"thumbsUpCount":0,"name":"Over Stars","mainFileId":7566405,"primaryCategoryId":4475,"downloadCount":265023,"status":4,"authors":[{"name":"NitroRiced","id":102638458,"url":"https://www.curseforge.com/members/nitroriced"}],"featured":false,"available":false} \ No newline at end of file