KTB-24 added test branch #1
This file contains hidden or 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
| name: Build and Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - KTB-24-github-deploy | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '24' | |
| - name: Build with Gradle | |
| run: ./gradlew shadowJar | |
| - name: Rename file | |
| run: mv build/libs/KotlinTelegramBot-1.0-SNAPSHOT-all.jar bot.jar | |
| - name: Deploy jar to VPS | |
| uses: appleboy/scp-action@v1 | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASSWORD }} | |
| source: bot.jar | |
| target: /root | |
| - name: Deploy words.txt to VPS | |
| uses: appleboy/scp-action@v1 | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASSWORD }} | |
| source: words.txt | |
| target: /root | |
| - name: Restart Remote Service | |
| uses: appleboy/ssh-action@v1 | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| password: ${{ secrets.SSH_PASSWORD }} | |
| script: | | |
| echo "Restarting service..." | |
| systemctl restart english-learning-bot | |
| sleep 5 | |
| echo "Service status:" | |
| systemctl status english-learning-bot --no-pager |