Added workflow to server
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
name: testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
main:
|
|
||||||
|
|
||||||
name: Transport repo to testing directory
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
container:
|
|
||||||
image: alpine/git
|
|
||||||
volumes:
|
|
||||||
- /mnt/host/c/Users/Leter/AppData/Roaming/.minecraft/versions/TeStVISt-server/git-mods/TeStVISt-mods:/workspace/LeterZP/mods
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: /workspace/LeterZP/mods
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: main
|
|
||||||
run: |
|
|
||||||
git fetch origin main
|
|
||||||
git reset --hard origin/main
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
name: pull
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
CONTAINER_NAME: mc-neoforge # название контейнера
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
saving:
|
||||||
|
|
||||||
|
name: Save and backup minecraft world
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: alpine/git
|
||||||
|
volumes:
|
||||||
|
- /imp-data/minecraft-backups:/workspace/backups # путь до бэкапов
|
||||||
|
- /opt/minecraft/TeStVISt-mods-seever:/workspace/project # путь до модов
|
||||||
|
- /opt/minecraft/data:/workspace/data # путь до данных майнкрафт-сервера
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: /workspace/backups
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: main
|
||||||
|
run: |
|
||||||
|
LAST_BACKUP_TIME=$(date +%F-%T)
|
||||||
|
mkdir $LAST_BACKUP_TIME
|
||||||
|
cp -R -t $LAST_BACKUP_TIME ../data/world
|
||||||
|
cp -t $LAST_BACKUP_TIME ../project/README.md
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pulling:
|
||||||
|
|
||||||
|
name: Pull repo to the mods directory
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: alpine/git
|
||||||
|
volumes:
|
||||||
|
- /opt/minecraft/TeStVISt-mods-seever:/workspace/project # путь до модов
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: /workspace/project
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: main
|
||||||
|
run: |
|
||||||
|
git fetch origin main
|
||||||
|
git reset --hard origin/main
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
restarting:
|
||||||
|
|
||||||
|
name: Restart minecraft server
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: main
|
||||||
|
run: |
|
||||||
|
docker exec ${{ env.CONTAINER_NAME }} rcon-cli stop
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user