Skip to content

Merge pull request #92 from Team-Wander/89-block-applications-when-full #20

Merge pull request #92 from Team-Wander/89-block-applications-when-full

Merge pull request #92 from Team-Wander/89-block-applications-when-full #20

Workflow file for this run

name: Build with Gradle and Run Docker Container
on:
push:
branches: ["develop"]
permissions:
contents: read
jobs:
build-and-run:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: clean bootJar
- name: Run Whoami
run: whoami
- name: docker image build
run: sudo docker build -t wandering-server .
- name: docker stop container
run: |
for container in $(sudo docker ps -q); do
name=$(sudo docker inspect --format='{{.Name}}' $container)
if [ "$name" != "/dozzle" ]; then
sudo docker stop $container
fi
done
- name: docker run new container
run: sudo docker run --name wanderingservercontainer --env-file /root/.env --rm -d -p 10000:8080 wandering-server
- name: delete old docker image
run: sudo docker system prune -f --filter "label!=dozzle"