Update test.yml #25
Workflow file for this run
This file contains 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: test | |
on: | |
push: | |
branches: [ "feature/ci-cd" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: decoding key file | |
run: | | |
echo ${{ secrets.SECURE_KEY_MANAGER_CERT_KEY }} > t3team-skm-cert.txt | |
ls & echo ---- | |
mkdir src/main/resources/key | |
base64 -d t3team-skm-cert.txt > src/main/resources/key/t3team-skm-cert.p12 | |
ls src/main/resources/key & echo ----; | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn ${{ secrets.MAVEN_PACKAGE_OPTIONS }} | |
- name : upload file | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SSH_IP }} | |
username: ${{ secrets.SSH_ID }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
source: "target/*.jar" | |
target: "~/" | |
rm: false | |
- name: execute shell script | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_IP }} | |
username: ${{ secrets.SSH_ID }} | |
key: ${{ secrets.SSH_KEY }} | |
port: ${{ secrets.SSH_PORT }} | |
script_stop: true | |
script: "kill $(lsof -i:${{ secrets.APPLICATION_PORT }} -t) & nohup java -jar ${{ secrets.JAVA_RUN_OPTION }} ~/target/*.jar > ~/deploy.log 2>&1 &" |