Skip to content

Merge pull request #439 from Team-Ampersand/revert-436-435-add-check-… #26

Merge pull request #439 from Team-Ampersand/revert-436-435-add-check-…

Merge pull request #439 from Team-Ampersand/revert-436-435-add-check-… #26

name: Java CICD with Gradle
on:
push:
branches:
- 'master'
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Stop Docker container
run: sudo docker rm -f dotori-prod 2>/dev/null || true
- name: Pull Docker image
run: sudo docker pull ${{secrets.DOCKERHUB_USERNAME}}/dotori-prod
- name: Run Docker Container
run: sudo docker run --net="host" --name dotori --rm -d -p 8080:8080 ${{secrets.DOCKERHUB_USERNAME}}/dotori-prod
- name: Delete old docker images
run: sudo docker system prune -f