Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment completed but output doesn't show code changes #248

Open
mahabub-mamun opened this issue Apr 28, 2023 · 2 comments
Open

Deployment completed but output doesn't show code changes #248

mahabub-mamun opened this issue Apr 28, 2023 · 2 comments

Comments

@mahabub-mamun
Copy link

mahabub-mamun commented Apr 28, 2023

I am trying to deploy a simple jar file with nohup command directly using appleboy/ssh-action. The problem that I face is that the deployment is completed without any issues. But when I try to check the changes I find out that the changes don't happen. if I try to manually deploy the same thing from the server. it works. the only difference that is when I use manual deployment I have a .sh script which I run with nohup command. below is the script that I use

  • name: ssh-deploy
    uses: appleboy/ssh-action@master
    with:
    host: ${{secrets.DEV_HOST}}
    username: ${{secrets.DEV_USERNAME}}
    key: ${{secrets.DEV_KEY}}
    port: ${{secrets.DEV_PORT}}
    script: |
    nohup java -DB_HOST=${{secrets.DEV_DB_HOST}} -DB_USER=${{secrets.DEV_DB_USER}} -DB_PASS='${{secrets.DEV_DB_PASS}}' -DSENDGRID_API_KEY='S${{secrets.SENGRID_API_KEY}}' -DAWS_S3_BUCKET_NAME='${{secrets.DAWS_S3_BUCKET}}' -DAWS_S3_OBJECT_KEY='${{secrets.DAWS_S3_OBJECT_KEY}}' -jar ${{secrets.DEV_APP_FOLDER}}/example-SNAPSHOT.jar > /dev/null 2>&1 &
    Can you please help me with this situation? I am trying to solve this for almost 2 weeks.
@appleboy
Copy link
Owner

appleboy commented Apr 29, 2023

Please try the solution #40 (comment) or #67 (comment)

@excelo0702
Copy link

I am also facing same issue. I have tried these mentioned solution but none of them worked for me. this is my workflow `filename: Deploy Spring Boot App

on:
push:
branches:
- master

jobs:
deploy:
runs-on: self-hosted

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

  - name: Set up JDK 17
    uses: actions/setup-java@v3
    with:
      java-version: '17'
      distribution: 'temurin'

  - name: Debug Port 8080 Usage
    run: |
      PORT_IN_USE=$(netstat -tuln | awk '$4 ~ /:8080$/ {print $7}' | cut -d'/' -f1)
      if [ -z "$PORT_IN_USE" ]; then
          echo "No process is using port 8080."
      else
          echo "Process using port 8080: $PORT_IN_USE"
          echo "Killing process $PORT_IN_USE"
          kill -9 "$PORT_IN_USE"
          echo "Process killed"
      fi

  - name: Build and Deploy
    run: |
      cd /home/tanish/actions-runner/tryfid_spring/TryFidBE/TryFidBE
      git pull origin master
      echo "Building with Maven..."
      mvn clean install
      echo "Maven build completed"
      

  - name: Complete
    run: |
      nohup java -jar target/tryfid-0.0.1-SNAPSHOT.jar  > ./output.log 2>&1 &
      echo "Deployment completed successfully."

``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants