Update main.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push] | |
jobs: | |
create_container: | |
name: Create container with mod | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_USER: thrane | |
DOCKER_BUILDKIT: 1 | |
MOD_JAR: BasseBombeCraft-1.15.2-1.42-server.jar | |
MOD_URL: https://github.com/athrane/bassebombecraft/releases/download/1.42.1/ | |
MC_VERSION: 1.15.2 | |
FORGE_VERSION: 31.1.10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: DockerHub login | |
run: docker login -u $DOCKER_USER -p ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build image | |
run: docker build . --build-arg MOD_JAR=$MOD_JAR --build-arg MOD_URL=$MOD_URL --build-arg MC_VERSION=$MC_VERSION --build-arg FORGE_VERSION=$FORGE_VERSION --file Dockerfile --tag bassebombecraft/minecraft:${{ github.sha }} --tag bassebombecraft/minecraft:latest | |
- name: Push image | |
run: docker push bassebombecraft/minecraft:${{ github.sha }} | |
- name: Push image | |
run: docker push bassebombecraft/minecraft:latest | |
test_mod: | |
name: Test mod in server | |
needs: create_container | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
services: | |
mcserver: | |
image: bassebombecraft/minecraft:latest | |
ports: | |
- 25565:25565 | |
options: --name minecraftserver | |
steps: | |
- name: Get Minecraft container health | |
run: /usr/bin/docker container inspect -f "{{.State.Health.Status}}" minecraftserver | |
- name: Display Minecraft container logs | |
run: /usr/bin/docker logs minecraftserver | |