This commit is contained in:
@@ -7,9 +7,20 @@ on:
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
# 清除可能存在的代理环境变量,防止 Docker 通过代理拉取镜像
|
||||
env:
|
||||
HTTP_PROXY: ""
|
||||
HTTPS_PROXY: ""
|
||||
http_proxy: ""
|
||||
https_proxy: ""
|
||||
NO_PROXY: "*"
|
||||
no_proxy: "*"
|
||||
steps:
|
||||
- name: 安装 Docker CLI
|
||||
run: |
|
||||
# 先写干净的 daemon.json,让 Docker 启动时就读到无代理配置
|
||||
mkdir -p /etc/docker
|
||||
echo '{}' > /etc/docker/daemon.json
|
||||
# 替换 Debian 源为清华镜像,避免国内连 deb.debian.org 超时
|
||||
sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null || true
|
||||
sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null || true
|
||||
@@ -19,11 +30,6 @@ jobs:
|
||||
- name: 拉取代码
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 清除 Docker 代理配置
|
||||
run: |
|
||||
echo '{}' | tee /etc/docker/daemon.json
|
||||
systemctl restart docker || true
|
||||
|
||||
- name: 构建镜像
|
||||
run: docker build -t telegram-downloader:latest .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user