Skip to content

Commit

Permalink
Update docker-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MemoryCollection authored Nov 21, 2024
1 parent 19f3800 commit 42c517b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,27 @@ jobs:
run: |
docker build -t memorycollection/iptv:latest .
# 测试 Python 无头浏览器是否能运行
- name: Test Python Headless Chrome
run: |
# 创建一个简单的 Python 脚本测试无头浏览器
echo '
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("--headless") # 无头模式
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
driver = webdriver.Chrome(options=options)
driver.get("https://www.google.com")
print("Successfully opened Google!")
driver.quit()
' > test_headless.py
# 运行该测试脚本
docker run --rm -v $PWD:/app memorycollection/iptv:latest python /app/test_headless.py
# 推送 Docker 镜像到 Docker Hub
- name: Push Docker Image
run: |
docker push memorycollection/iptv:latest

0 comments on commit 42c517b

Please # to comment.