Skip to content

Commit

Permalink
refactor(workflows): 불필요한 주석 제거 및 코드 개선
Browse files Browse the repository at this point in the history
- 주석 제거
- 실행 확인 시 sleep 줄이기
- 실행 중인 jar 파일 확인 폴더 한정
- 불필요한 중괄호 제거
  • Loading branch information
kyum-q committed Jul 22, 2024
1 parent e99a34e commit ef68aed
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/backend_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ jobs:
steps:
- name: Get Artifact Download URL
id: get-artifact-url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
artifacts=$(curl -H "Authorization: token $GITHUB_TOKEN" \
artifacts=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/actions/artifacts)
artifact_id=$(echo "$artifacts" | jq -r '.artifacts[0].id') # 가장 최근 아티팩트의 id를 가져옴
artifact_id=$(echo "$artifacts" | jq -r '.artifacts[0].id')
if [[ -z "$artifact_id" || "$artifact_id" == "null" ]]; then
echo "Artifact ID not found or invalid"
exit 1
Expand All @@ -62,11 +60,9 @@ jobs:
echo "DOWNLOAD_URL=${download_url}" >> $GITHUB_ENV
- name: Download Artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORK_DIRECTORY: ${{ secrets.WORK_DIRECTORY }}
run: |
curl -L -o ${{ secrets.WORK_DIRECTORY }}/code-zap-jar.zip -H "Authorization: token $GITHUB_TOKEN" ${{ env.DOWNLOAD_URL }}
curl -L -o ${{ secrets.WORK_DIRECTORY }}/code-zap-jar.zip -H \
"Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ env.DOWNLOAD_URL }}
- name: Run Deploy Script
run: |
Expand All @@ -76,5 +72,5 @@ jobs:
- name: Verify Deploy Succeed
run: |
sleep 10 # Ensure there is enough time for the application to start
pgrep -f 'java -jar' || { echo "Deploy Failed" }
sleep 3
pgrep -f 'java -jar.code-zap.*\.jar' || echo "Deploy Failed"

0 comments on commit ef68aed

Please sign in to comment.