name: Deploy to Server (Docker)

on:
  push:
    branches:
      - main
      - train_go

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3

      - name: Build Docker image
        run: docker build -t registry.gocommunity.ru:5000/my-app-image . 
      
      - name: List Docker image
        run: docker images

      - name: Login to registry hub.    
        run: docker login -u podman -p PodMan25! registry.gocommunity.ru:5000

      - name: Push Docker image to registry
        run: docker push registry.gocommunity.ru:5000/my-app-image:latest

      - name: Push Docker image to registry
        run: echo "Happy New Year!!"