💚 ci: Chrome 바이너리 경로 설정 및 확인 단계 추가
- CI 환경에서 Chrome 바이너리 경로를 환경 변수로 설정하도록 수정 - Chrome 버전 확인 명령어를 setup-chrome의 출력값을 사용하도록 변경
This commit is contained in:
4
.github/workflows/lotto-buy.yml
vendored
4
.github/workflows/lotto-buy.yml
vendored
@@ -74,6 +74,7 @@ jobs:
|
||||
.venv/bin/pip install -r lotto-runner/requirements.txt
|
||||
|
||||
- name: Chrome 설치
|
||||
id: setup-chrome
|
||||
uses: browser-actions/setup-chrome@v1
|
||||
with:
|
||||
install-dependencies: true
|
||||
@@ -81,7 +82,7 @@ jobs:
|
||||
|
||||
- name: Chrome 확인
|
||||
run: |
|
||||
chrome --version || google-chrome --version || chromium --version
|
||||
"${{ steps.setup-chrome.outputs.chrome-path }}" --version
|
||||
|
||||
- name: 로또 구매 실행
|
||||
env:
|
||||
@@ -89,4 +90,5 @@ jobs:
|
||||
LOTTO_USER_PW: ${{ secrets.LOTTO_USER_PW }}
|
||||
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
||||
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
|
||||
CHROME_BIN: ${{ steps.setup-chrome.outputs.chrome-path }}
|
||||
run: .venv/bin/python3 lotto-runner/lotto_auto_buy.py
|
||||
|
||||
@@ -59,6 +59,10 @@ logger = logging.getLogger(__name__)
|
||||
def create_driver():
|
||||
"""Chrome WebDriver 생성"""
|
||||
options = Options()
|
||||
# CI 환경에서 setup-chrome이 설치한 Chrome 바이너리 경로 지정
|
||||
chrome_bin = os.environ.get("CHROME_BIN", "")
|
||||
if chrome_bin:
|
||||
options.binary_location = chrome_bin
|
||||
if CONFIG["HEADLESS"]:
|
||||
options.add_argument("--headless=new")
|
||||
options.add_argument("--no-sandbox")
|
||||
|
||||
Reference in New Issue
Block a user