Skip to content

Commit 6d212b6

Browse files
committed
modify: github action 수정 v6, token refresh 도 추가
1 parent 323b262 commit 6d212b6

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/worker_main.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ jobs:
3434
pythonLocation: /opt/hostedtoolcache/Python/3.10.13/x64
3535
DB_URL: ${{ secrets.DB_URL }}
3636
PERIOD_MIN: ${{ secrets.PERIOD_MIN }}
37+
WORKER_ENV: ${{ secrets.WORKER_ENV }}
3738
run: |
3839
cd ./worker
3940
mkdir logs
4041
python main.py
41-
cat ./logs/logfile.log
42+
cat ./logs/velog-dashboard-worker.log
4243
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: run token_refresh.py
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: "*/20 * * * *" # 20분 마다
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo content
15+
uses: actions/checkout@v2
16+
17+
- name: Setup python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.10"
21+
22+
- name: Install python packages
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install aiohttp
26+
pip install motor
27+
pip install pydantic
28+
pip install pytz
29+
pip install aiohttp-retry
30+
pip install python-dotenv
31+
32+
- name: Execute Python script in the worker directory
33+
env:
34+
pythonLocation: /opt/hostedtoolcache/Python/3.10.13/x64
35+
DB_URL: ${{ secrets.DB_URL }}
36+
PERIOD_MIN: ${{ secrets.PERIOD_MIN }}
37+
WORKER_ENV: ${{ secrets.WORKER_ENV }}
38+
run: |
39+
cd ./worker
40+
mkdir logs
41+
python token_refresh.py
42+
cat ./logs/velog-dashboard-token-worker.log

0 commit comments

Comments
 (0)