Skip to content

Commit

Permalink
Merge pull request #2278 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
Workflow dispatch workflow file
  • Loading branch information
aswanthabam authored Jan 4, 2025
2 parents 8ee1135 + 545729d commit 95288ac
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/dev-deploy-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Dev CI

on:
workflow_dispatch:
inputs:
branch:
description: "Branch to deploy"
required: true
default: "dev-server"

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Configure SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEV_SSH_PRIVATE_KEY }}

- name: Deploy
env:
REMOTE_IP: ${{ secrets.DEV_REMOTE_IP }}
PROJECT_PATH: ${{ secrets.PROJECT_PATH }}
BRANCH_NAME: ${{ github.event.inputs.branch }}
run: |
ssh -o StrictHostKeyChecking=no ubuntu@$REMOTE_IP "
cd $PROJECT_PATH &&
git fetch origin &&
git checkout $BRANCH_NAME &&
git reset --hard origin/$BRANCH_NAME &&
docker-compose down &&
docker-compose up --build -d
"

0 comments on commit 95288ac

Please sign in to comment.