Skip to content

Commit e21ec8e

Browse files
committed
feat(workflows): 修改workflows
1 parent a9e25de commit e21ec8e

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.DS_Store

-10 KB
Binary file not shown.

.github/workflows/docker-image.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@v2
4040
# 构建镜像,指定镜像名
41-
- name: Build image
42-
run: |
43-
# 如果版本不带ffmpeg,打包之前将Dockerfile中的ffmpeg替换为空
44-
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
45-
sed -i 's/ffmpeg//g' Dockerfile
46-
fi
47-
docker build . --file Dockerfile --tag $IMAGE_NAME
48-
# 登录到 dockerhub,使用 GitHub secrets 传入账号密码,密码被加密存储在 GitHub 服务器,添加方法见下图。
4941
- name: Log into registry
5042
run: echo "${{ secrets.ACCESS_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
5143

@@ -71,6 +63,12 @@ jobs:
7163
7264
# 设置镜像 id 和版本号
7365
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
66+
67+
# 如果VERSION不带ffmpeg,打包之前将Dockerfile中的ffmpeg替换为空
68+
if [[ $VERSION != *"ffmpeg"* ]]; then
69+
sed -i 's/ffmpeg//g' Dockerfile
70+
fi
71+
7472
# 创建一个多平台构建环境
7573
docker buildx create --name multi-platform --use --platform linux/amd64,linux/arm64 --driver docker-container
7674
# 进行 push

0 commit comments

Comments
 (0)