Skip to content

v1.6.1

v1.6.1 #33

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Modify configuration files
run: |
sed -i 's#<property name="LOG_PATH" value=".*" />#<property name="LOG_PATH" value="${{ secrets.LOG_PATH }}" />#' tang-admin/src/main/resources/logback.xml
sed -i '0,/password: .*/s/password: .*/password: ${{ secrets.DATABASE_PASSWORD }}/' tang-admin/src/main/resources/application-prod.yml
sed -i '0,/password/! {s/password: .*/password: ${{ secrets.REDIS_PASSWORD }}/}' tang-admin/src/main/resources/application-prod.yml
echo -e '\ntang:\n uploads: ${{ secrets.UPLOAD_PATH }}' >> tang-admin/src/main/resources/application-prod.yml
- name: Build with Maven
run: sh bin/package.sh
#- name: Deploy to server
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.SERVER_HOST }}
# username: ${{ secrets.SERVER_USERNAME }}
# password: ${{ secrets.SERVER_PASSWORD }}
# port: 22
# source: tang-admin/target/tang-admin-*.jar
# target: /root/tang-boot/
#- name: Run JAR file
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.SERVER_HOST }}
# username: ${{ secrets.SERVER_USERNAME }}
# password: ${{ secrets.SERVER_PASSWORD }}
# script: |
# cd /root/tang-boot/
# kill -9 $(ps -ef |grep tang-admin-* | grep -v grep | awk '{print $2}')
# nohup java -Dlogging.config=classpath:logback.xml -jar tang-admin-*.jar > /dev/null 2>&1 &