add: action
Some checks failed
Build and Deploy / build (push) Has been cancelled

This commit is contained in:
2025-07-21 00:09:53 +05:00
parent e59669f66a
commit 2bd081fe7a
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,41 @@
name: Build and Deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: git.popa-popa.ru
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: git.popa-popa.ru/DIKER/minecraft-api:latest # Замените username на ваше имя пользователя
- name: Deploy to server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/server/minecraft-api/
docker pull git.popa-popa.ru/DIKER/minecraft-api:latest
docker-compose up -d