Skip to content

20 [deploy to dockerhub] #75

20 [deploy to dockerhub]

20 [deploy to dockerhub] #75

Workflow file for this run

name: Deploy to Dev Server
on:
push:
branches:
- jh-dev
paths-ignore:
- '**.github/workflows/**' # Ignore changes to workflow files
if: "contains(github.event.head_commit.message, '[deploy to dev]')" # Adjust trigger condition as needed
jobs:
deploy-to-dev-server:
if: "contains(github.event.head_commit.message, '[deploy to dev]')"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Dev Server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_SERVER_HOST }}
username: ${{ secrets.DEV_SERVER_USERNAME }}
key: ${{ secrets.DEV_SERVER_SSH_PRIVATE_KEY }}
- name: Copy deploy.sh to Dev Server
run: |
scp deploy.sh ${{ secrets.DEV_SERVER_USERNAME }}@${{ secrets.DEV_SERVER_HOST }}:~/deploy.sh
- name: Execute deploy.sh on Dev Server
run: |
ssh ${{ secrets.DEV_SERVER_USERNAME }}@${{ secrets.DEV_SERVER_HOST }} \
"chmod +x ~/deploy.sh && ~/deploy.sh"