Skip to content

Workflow file for this run

name: Build project and publish to server
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Build project with Maven
run: mvn clean package -DskipTests
- name: List target directory with artifacts
run: ls -la target/
- name: Copy modules to remote server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: 22
script: |

Check failure on line 34 in .github/workflows/dev-publish.yml

View workflow run for this annotation

GitHub Actions / Build project and publish to server

Invalid workflow file

The workflow is not valid. .github/workflows/dev-publish.yml (Line: 34, Col: 9): Unexpected value 'script'
ls -la target/*.jar # Verify the jar file exists
scp target/*.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/deploy/artifacts/app.jar
- name: Restart service
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: 22
script: |
docker-compose -f /deploy/docker-compose.yml restart app