-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: backend deploy yml 작성 * refactor: frontend CD ubuntu 버전 지정 * fix: workflow 이름 변경 * fix: secret 이름 및 디렉토리 변경
- Loading branch information
Showing
3 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: backend-deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
working-directory: ./backend | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
- name: Build App | ||
run: ./gradlew bootJar | ||
|
||
- name: SCP | ||
uses: appleboy/scp-action@master | ||
with: | ||
username: ubuntu | ||
host: ${{ secrets.HOST_WAS1 }} | ||
key: ${{ secrets.PRIVATE_KEY_WAS1 }} | ||
source: "./backend/build/libs/*.jar" | ||
target: "/home/ubuntu/backend" | ||
strip_components: 3 | ||
|
||
- name: Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
username: ubuntu | ||
host: ${{ secrets.HOST_WAS1 }} | ||
key: ${{ secrets.PRIVATE_KEY_WAS1 }} | ||
script: | | ||
sudo /home/ubuntu/deploy/deploy.sh | ||
- name: action-slack | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
author_name: Github Action # default: 8398a7@action-slack | ||
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required | ||
if: always() |
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
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