Skip to content

Commit 4e0de43

Browse files
authored
Merge pull request #188 from BCSDLab/develop
develop -> master
2 parents 5bfe0ca + 38c92d0 commit 4e0de43

36 files changed

Lines changed: 208 additions & 2733 deletions

.github/workflows/deploy-prod.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: KOIN_BATCH CD (production)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy:
8+
if: github.ref == 'refs/heads/master'
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Record start time
15+
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
16+
17+
- name: Notify Slack - Deploy Start
18+
env:
19+
ACTIONS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
20+
run: |
21+
COMMIT_MSG=$(git log -1 --pretty=%s HEAD)
22+
curl -X POST ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }} \
23+
-H 'Content-Type: application/json' \
24+
-d "{
25+
\"text\": \":rocket: *[Develop] 배포 시작*\n• Repo: ${{ github.repository }}\n• Branch: develop\n• Author: @${{ github.actor }}\n• Commit: ${COMMIT_MSG}\n• <${ACTIONS_URL}|Actions 보기>\"
26+
}"
27+
28+
- name: Create tar archive
29+
run: |
30+
tar -cvzf batch.tar.gz --exclude='.git' --exclude='.github' --exclude='.gitignore' . || true
31+
32+
- name: Transfer archive via SCP
33+
uses: appleboy/scp-action@v0.1.7
34+
with:
35+
host: ${{ secrets.PROD_SSH_HOST }}
36+
username: ${{ secrets.PROD_SSH_USER }}
37+
key: ${{ secrets.PROD_SSH_KEY }}
38+
port: ${{ secrets.PROD_SSH_PORT }}
39+
source: batch.tar.gz
40+
target: ${{ secrets.PROD_DEPLOY_PATH }}
41+
42+
- name: Run deploy script via SSH
43+
uses: appleboy/ssh-action@v1.0.3
44+
with:
45+
host: ${{ secrets.PROD_SSH_HOST }}
46+
username: ${{ secrets.PROD_SSH_USER }}
47+
key: ${{ secrets.PROD_SSH_KEY }}
48+
port: ${{ secrets.PROD_SSH_PORT }}
49+
script: bash ${{ secrets.PROD_DEPLOY_SCRIPT_PATH }}
50+
51+
- name: Notify Slack - Deploy Result
52+
if: always()
53+
env:
54+
ACTIONS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
55+
run: |
56+
COMMIT_MSG=$(git log -1 --pretty=%s HEAD)
57+
DURATION_SEC=$(( $(date +%s) - START_TIME ))
58+
DURATION="${DURATION_SEC}초 (약 $(( DURATION_SEC / 60 ))분)"
59+
if [ "${{ job.status }}" = "success" ]; then
60+
ICON=":white_check_mark:"
61+
STATUS="배포 성공"
62+
else
63+
ICON=":x:"
64+
STATUS="배포 실패"
65+
fi
66+
curl -X POST ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }} \
67+
-H 'Content-Type: application/json' \
68+
-d "{
69+
\"text\": \"${ICON} *[Develop] ${STATUS}*\n• Repo: ${{ github.repository }}\n• Branch: develop\n• Author: @${{ github.actor }}\n• Commit: ${COMMIT_MSG}\n• Duration: ${DURATION}\n• <${ACTIONS_URL}|Actions 보기>\"
70+
}"

.github/workflows/deploy-stage.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: KOIN_BATCH CD (stage)
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Record start time
15+
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV
16+
17+
- name: Notify Slack - Deploy Start
18+
env:
19+
ACTIONS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
20+
run: |
21+
COMMIT_MSG=$(git log -1 --pretty=%s HEAD)
22+
curl -X POST ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }} \
23+
-H 'Content-Type: application/json' \
24+
-d "{
25+
\"text\": \":rocket: *[Develop] 배포 시작*\n• Repo: ${{ github.repository }}\n• Branch: develop\n• Author: @${{ github.actor }}\n• Commit: ${COMMIT_MSG}\n• <${ACTIONS_URL}|Actions 보기>\"
26+
}"
27+
28+
- name: Create tar archive
29+
run: |
30+
tar -cvzf batch.tar.gz --exclude='.git' --exclude='.github' --exclude='.gitignore' . || true
31+
32+
- name: Transfer archive via SCP
33+
uses: appleboy/scp-action@v0.1.7
34+
with:
35+
host: ${{ secrets.STAGE_SSH_HOST }}
36+
username: ${{ secrets.STAGE_SSH_USER }}
37+
key: ${{ secrets.STAGE_SSH_KEY }}
38+
port: ${{ secrets.STAGE_SSH_PORT }}
39+
source: batch.tar.gz
40+
target: ${{ secrets.STAGE_DEPLOY_PATH }}
41+
42+
- name: Run deploy script via SSH
43+
uses: appleboy/ssh-action@v1.0.3
44+
with:
45+
host: ${{ secrets.STAGE_SSH_HOST }}
46+
username: ${{ secrets.STAGE_SSH_USER }}
47+
key: ${{ secrets.STAGE_SSH_KEY }}
48+
port: ${{ secrets.STAGE_SSH_PORT }}
49+
script: bash ${{ secrets.STAGE_DEPLOY_SCRIPT_PATH }}
50+
51+
- name: Notify Slack - Deploy Result
52+
if: always()
53+
env:
54+
ACTIONS_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
55+
run: |
56+
COMMIT_MSG=$(git log -1 --pretty=%s HEAD)
57+
DURATION_SEC=$(( $(date +%s) - START_TIME ))
58+
DURATION="${DURATION_SEC}초 (약 $(( DURATION_SEC / 60 ))분)"
59+
if [ "${{ job.status }}" = "success" ]; then
60+
ICON=":white_check_mark:"
61+
STATUS="배포 성공"
62+
else
63+
ICON=":x:"
64+
STATUS="배포 실패"
65+
fi
66+
curl -X POST ${{ secrets.SLACK_DEPLOY_WEBHOOK_URL }} \
67+
-H 'Content-Type: application/json' \
68+
-d "{
69+
\"text\": \"${ICON} *[Develop] ${STATUS}*\n• Repo: ${{ github.repository }}\n• Branch: develop\n• Author: @${{ github.actor }}\n• Commit: ${COMMIT_MSG}\n• Duration: ${DURATION}\n• <${ACTIONS_URL}|Actions 보기>\"
70+
}"

crawling/dcinside_gallery.py

Lines changed: 0 additions & 131 deletions
This file was deleted.

crawling/get_holiday.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)