Update README.md #140
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
#name: Java CI with Maven | |
# | |
#on: | |
# push: | |
## branches: [ "main" ] | |
# branches: [ "fake_branch" ] # чтобы не запускался деплой | |
# pull_request: | |
# branches: [ "main" ] | |
# | |
#jobs: | |
# build: | |
# name: Build & test & push to dockerHUB | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Copying project to runner | |
# uses: actions/checkout@v3 # копирует проект в runner | |
# - name: Set up JDK 17 | |
# uses: actions/setup-java@v3 # конфигурирует Eclipse 17 JDK | |
# with: | |
# java-version: '17' | |
# distribution: 'adopt' | |
# cache: maven | |
# - name: Build with Maven | |
# run: mvn -f ./ clean install | |
# | |
# - name: Build & push docker image | |
# uses: mr-smithers-excellent/docker-build-push@v5 # пушит image в dockerHUB | |
# with: | |
# image: shulpov/spring-boot-spots-app | |
# tags: latest | |
# registry: docker.io | |
# dockerfile: ./Dockerfile | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
# | |
# deploy: | |
# name: Pull from docker & run images | |
# runs-on: ubuntu-latest | |
# needs: ["build"] | |
# steps: | |
# - name: multiple command | |
# uses: appleboy/ssh-action@v0.1.8 # подключается по SSH к remote server | |
# with: | |
# host: ${{ secrets.FTP_IP_ADDRESS }} | |
# username: ${{ secrets.FTP_REMOTE_USER }} | |
# password: ${{ secrets.FTP_PASSWORD }} | |
# script: | | |
# whoami | |
# docker login -u ${{ secrets.DOCKER_USERNAME}} -p ${{ secrets.DOCKER_PASSWORD }} | |
# docker rmi $(docker images 'shulpov/spring-boot-spots-app' -a -q) | |
# docker stop spots_app | |
# docker pull shulpov/spring-boot-spots-app | |
# | |
# docker run -d -p 8080:8080 --name spots_app --rm shulpov/spring-boot-spots-app | |
## docker logs spots_app >& logs/springLogs.log | |
# # -d запуск в фоне, --name имя контейнера, --rm удалить контейнер, когда он остановится | |
# | |
# | |
# | |
# | |
# | |
# | |
# |