feat: changed deploy.yml

This commit is contained in:
filippo-ferrari 2024-09-06 21:12:53 +02:00
parent dc59937180
commit 159486cfb0
2 changed files with 11 additions and 7 deletions

View file

@ -13,8 +13,13 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up JDK 22
uses: actions/setup-java@v3
with:
java-version: '22'
- name: Build JAR - name: Build JAR
run: ./mvnw clean package -DskipTests run: ./mvnw clean package -DskipTests # Adjust this based on your build tool
- name: Upload JAR to server - name: Upload JAR to server
run: scp -i ${{ secrets.SSH_KEY }} target/munera-1.0-SNAPSHOT.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera run: scp -i ${{ secrets.SSH_KEY }} target/munera-1.0-SNAPSHOT.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera
@ -26,9 +31,8 @@ jobs:
run: scp -i ${{ secrets.SSH_KEY }} docker-compose.yml ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera run: scp -i ${{ secrets.SSH_KEY }} docker-compose.yml ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera
- name: Deploy on server - name: Deploy on server
run: | run: ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF'
ssh -i ${{ secrets.SSH_KEY }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF' cd /home/${{ secrets.SSH_USER }}/munera
cd /home/${{ secrets.SSH_USER }}/munera docker-compose down
docker-compose down docker-compose up --build -d
docker-compose up --build -d EOF
EOF

Binary file not shown.