Skip to content

Sabia Platform Blog - Production Deployment Dispatch #7

Sabia Platform Blog - Production Deployment Dispatch

Sabia Platform Blog - Production Deployment Dispatch #7

name: Sabia Platform Blog - Production Deployment Dispatch
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
id: docker_build_admin
uses: docker/build-push-action@v2
with:
push: true
file: ./Dockerfile
tags: plataformasabia/blog-api:${{ github.sha }}
- name: Executing remote ssh commands using ssh key on vps_1
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST_VPS_1 }}
username: ${{ secrets.DEPLOY_USER_VPS_1 }}
key: ${{ secrets.DEPLOY_KEY_VPS_1 }}
port: ${{ secrets.DEPLOY_PORT_VPS_1 }}
script: ./deploy-image-to-vps-blog-api.sh ${{ github.sha }}