Skip to content

Build, Test, and Push Services #38

Build, Test, and Push Services

Build, Test, and Push Services #38

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- deploy
jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# # 1. Checkout репозиторий
# - name: Checkout code
# uses: actions/checkout@v4
# # 2. Логинимся в DockerHub
# - name: Login to DockerHub Registry
# run: echo dckr_pat_6HmV5MDVrUU3Wfzu59ejhGGOBjs | docker login -u rasulovarsen --password-stdin
# # 3. Build ads_service
# - name: Build and push ads_service
# uses: docker/build-push-action@v4
# with:
# context: .
# file: ./microservices/ads_service/Dockerfile
# tags: rasulovarsen/ads_service:latest
# push: true
# - name: Build and push auth_service
# uses: docker/build-push-action@v4
# with:
# context: .
# file: ./microservices/auth_service/Dockerfile
# tags: rasulovarsen/auth_service:latest
# push: true
# - name: Build and push city_service
# uses: docker/build-push-action@v4
# with:
# context: .
# file: ./microservices/city_service/Dockerfile
# tags: rasulovarsen/city_service:latest
# push: true
# - name: Build and push migrator
# uses: docker/build-push-action@v4
# with:
# context: .
# file: ./cmd/migrator/Dockerfile
# tags: rasulovarsen/migrator:latest
# push: true
# - name: Build and push backend
# uses: docker/build-push-action@v4
# with:
# context: .
# file: ./Dockerfile
# tags: rasulovarsen/backend:latest
# push: true
deploy:

Check failure on line 62 in .github/workflows/docker.yml

View workflow run for this annotation

GitHub Actions / Build and Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/docker.yml (Line: 62, Col: 5): The workflow must contain at least one job with no dependencies.
runs-on: ubuntu-latest
needs: build
steps:
# 5. Развертывание на виртуалке
- name: Deploy on Virtual Machine
uses: appleboy/ssh-action@v1.2.0
with:
host: 37.139.41.110
username: ubuntu
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/ubuntu/
if [ ! -d backend ]; then git clone https://github.com/go-park-mail-ru/2024_2_Fight-club backend
else cd backend
fi
git fetch --all
git switch deploy -f
git reset --hard origin/deploy
docker rm -f $(sudo docker ps -aq)
docker compose up -d