Skip to content

Merge branch 'main' of https://github.com/blacksmithop/blacksmithop #11

Merge branch 'main' of https://github.com/blacksmithop/blacksmithop

Merge branch 'main' of https://github.com/blacksmithop/blacksmithop #11

name: Docker and Remote SSH Command
on:
push:
branches:
- main
jobs:
docker:
name: Docker Build and Push
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: blacksmithop/homepage:latest
cache-from: type=gha
cache-to: type=gha,mode=max
remote_ssh:
name: Deploy docker image in remote server
runs-on: ubuntu-latest
needs: docker
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd /home/abhi/Projects/blacksmithop
sh deploy.sh