Skip to content

added new event

added new event #23

Workflow file for this run

name: Update containers on Remote Host
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up node v16
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Log files in pwd
run: ls -al
- name: Build image & push to docker hub
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: rohitshah1706/synergy
tags: latest
registry: docker.io
dockerfile: Dockerfile
# buildArgs: VITE_API_GATEWAY_BASE_URL=${{ secrets.VITE_API_GATEWAY_BASE_URL }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
deploy-container:
needs: build-and-push
runs-on: ubuntu-latest
if: ${{ success() }} # ! we only want to deploy if the build was successful
steps:
- name: executing remote ssh commands
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.HOST_IP }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
cd synergy23
docker compose pull
docker image ls
docker compose up -d
docker ps -a