fix docker image building
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -2,12 +2,13 @@ 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
|
||||
@@ -15,16 +16,31 @@ jobs:
|
||||
- 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 }}
|
||||
registry: ${{ secrets.GIT_HOST }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push image
|
||||
- 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
|
||||
|
||||
+4
-4
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
ironveil:
|
||||
image: ironveil:latest
|
||||
image: ${{ secrets.GIT_HOST }}/${{ github.repository }}:latest
|
||||
container_name: ironveil
|
||||
volumes:
|
||||
- ./world:/server/world
|
||||
@@ -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"}}}}
|
||||
@@ -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}
|
||||
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user