Update Cathand.yml #15
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: CatHand | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- dev | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: gradlew bootJar | |
run: ./gradlew bootJar | |
- name: copy jar to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ec2-user | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
source: "./build/libs/*.jar" | |
target: "~" | |
strip_components: 2 | |
- name: SSH Commands | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ec2-user | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
script_stop: true | |
script: | | |
export PROD_DB_URL=${{ secrets.PROD_DB_URL }} | |
export PROD_DB_USER=${{ secrets.PROD_DB_USER }} | |
export PROD_DB_PASSWORD=${{ secrets.PROD_DB_PASSWORD }} | |
export ADMIN_SECRET_CODE=${{ secrets.ADMIN_SECRET_CODE }} | |
export AUTH_KEY=${{ secrets.AUTH_KEY }} | |
export JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} | |
export GMAIL_PASSWORD=${{ secrets.GMAIL_PASSWORD }} | |
export GMAIL_USERNAME=${{ secrets.GMAIL_USERNAME }} | |
java -jar *.jar | |
env: | |
PROD_DB_URL: ${{ secrets.PROD_DB_USER }} | |
PROD_DB_USER: ${{ secrets.PROD_DB_USER }} | |
PROD_DB_PASSWORD: ${{ secrets.PROD_DB_PASSWORD }} | |
ADMIN_SECRET_CODE: ${{ secrets.ADMIN_SECRET_CODE }} | |
AUTH_KEY: ${{ secrets.AUTH_KEY }} | |
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} | |
GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }} | |
GMAIL_USERNAME: ${{ secrets.GMAIL_USERNAME }} |