LETS GO #35
Workflow file for this run
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: 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. Билдим наш проект | |
- uses: mr-smithers-excellent/docker-build-push@v6 | |
name: Build & push Docker image | |
with: | |
image: rasulovarsen/fight-club | |
tags: latest | |
registry: docker.io | |
username: rasulovarsen | |
password: dckr_pat_6HmV5MDVrUU3Wfzu59ejhGGOBjs | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
# 3. Развертывание на виртуалке | |
- 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: | | |
docker compose -f /tmp/docker-compose.yml/docker-compose.yml up -d |