[bugfix/Inhabas#286] github actions 개선 및 버그 수정 #51
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: deploy-dev | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: copy file via ssh | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.IBAS_DEV_HOST }} | |
username: ${{ secrets.IBAS_DEV_USERNAME }} | |
key: ${{ secrets.IBAS_DEV_SSH_KEY }} | |
passphrase: ${{ secrets.IBAS_DEV_PASSWORD }} | |
# port: ${{ secrets.PORT }} # default : 22 | |
source: "resource-server/build/libs/resource-server-0.0.1-SNAPSHOT.jar" | |
target: ${{ secrets.IBAS_DEV_DEPLOY_PATH }} | |
strip_components: 3 | |
- name: execute deploy shell script via ssh | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.IBAS_DEV_HOST }} | |
username: ${{ secrets.IBAS_DEV_USERNAME }} | |
key: ${{ secrets.IBAS_DEV_SSH_KEY }} | |
passphrase: ${{ secrets.IBAS_DEV_PASSWORD }} | |
# port: ${{ secrets.PORT }} # default : 22 | |
script: | | |
bash ${{ secrets.IBAS_DEV_DEPLOY_PATH }}/deploy.sh |