Skip to content

fix : 배포 성공 메세지 클릭 url 오타 수정 #5

fix : 배포 성공 메세지 클릭 url 오타 수정

fix : 배포 성공 메세지 클릭 url 오타 수정 #5

name: Test And Build And Deploy
on:
push:
branches: [ 'main' ]
jobs:
build_and_test:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Import secret files
run: |
echo -e "${{ secrets.APPLICATION_COMMON}}" >> ./src/main/resources/application-common.yml
echo -e "${{ secrets.APPLICATION_PRODUCT}}" >> ./src/main/resources/application-product.yml
echo -e "${{ secrets.APPLICATION_LOCAL}}" >> ./src/main/resources/application-local.yml
echo -e "${{ secrets.APPLICATION_INFO_LOGGING}}" >> ./src/main/resources/application-info-logging.yml
echo -e "${{ secrets.APPLICATION_DEBUG_LOGGING}}" >> ./src/main/resources/application-debug-logging.yml
- name: Build with Gradle
continue-on-error: true
id: build_and_test
run:
./gradlew clean build --stacktrace
- name: Deploy file
continue-on-error: true
uses: wlixcc/[email protected]
id: deploy_file
if: ${{ steps.build_and_test.outcome == 'success'}}
with:
username: ${{ secrets.SSH_USERNAME }}
server: ${{ secrets.SSH_HOST }}
local_path: './build/libs/*'
remote_path: ${{ secrets.SSH_REMOTE_PATH }}
sftp_only: true
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Send Deploy Fail Message to Discord
continue-on-error: true
if: ${{ steps.deploy_file.outcome == 'failure'}}
run: |
curl --location ${{secrets.DISCORD_WEBHOOK_URL}} \
--header 'Content-Type: application/json' \
--data '{
"avatar_url": "https://cdn-icons-png.flaticon.com/512/25/25231.png",
"embeds": [
{
"title": "배포가 실패했습니다.",
"type": "rich",
"description": "배포가 실패했습니다.",
"url": "https://github.com/Cafegory/Cafegory_Backend_REST_API"
}
]}'
- name: Send Deploy Success Message to Discord
continue-on-error: true
if: ${{ steps.deploy_file.outcome == 'success'}}
run: |
curl --location ${{secrets.DISCORD_WEBHOOK_URL}} \
--header 'Content-Type: application/json' \
--data '{
"avatar_url": "https://cdn-icons-png.flaticon.com/512/25/25231.png",
"embeds": [
{
"title": "배포 성공!!",
"type": "rich",
"description": "배포가 성공했습니다!!! 아싸!!!",
"url": "${{ secrets.HTTP_API_SERVER_URL}}"
}
]}'