-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2278 from gtech-mulearn/dev
Workflow dispatch workflow file
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
" |