Skip to content

Commit

Permalink
ci: github worflow新增push PKU repository (#708)
Browse files Browse the repository at this point in the history
改动:
1. 在现有的workflow下,在Test, Build and Publish Projects内的build images
job里新增使用账号密码docker login 到PKU_CR:`mirrors.eecser.com`,此账号密码保存在github
secrets内,key分别为`PKUREGISTRY_USERNAME`和`PKUREGISTRY_PASSWORD`。
2. 将build好的image上传至`mirrors.eecser.com/pkuhpc-icode/xxx: {tag}`下
3. 通过`mirror.pku.edu.cn/pkuhpc-icode/xxx:
{tag}`可以拉到最新push到`mirrors.eecser.com/pkuhpc-icode/xxx: {tag}`的镜像

自测:
已在58集群拉取到该image

![image](https://github.com/PKUHPC/SCOW/assets/130351655/859c9764-4f09-4673-9a7d-c81056b9e903)


关于push的速度问题: 经测试偶尔时间达到将近十多分钟,可以考虑后续只对release或者合master的image
推到该仓库,其他pr的image继续使用github的仓库即可。
  • Loading branch information
ZihanChen821 authored Jul 4, 2023
1 parent f76716b commit c9723cc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test-build-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
GITHUB_CR: ghcr.io
PKU_CR: mirrors.eecser.com
PKU_PROJECT_NAME: pkuhpc-icode
# ALIYUN_CR: registry.cn-hangzhou.aliyuncs.com
# ALIYUN_PROJECT_NAME: scow

Expand Down Expand Up @@ -123,6 +125,7 @@ jobs:
name: scow-cli-arm64
path: apps/cli/exe/cli-arm64


build-images:
needs: test-version-packages
runs-on: ubuntu-latest
Expand Down Expand Up @@ -158,12 +161,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to the PKU registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ${{ env.PKU_CR }}
username: ${{ secrets.PKUREGISTRY_USERNAME }}
password: ${{ secrets.PKUREGISTRY_PASSWORD }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.GITHUB_CR }}/${{ github.repository }}/${{ matrix.name }}
${{ env.PKU_CR }}/${{ env.PKU_PROJECT_NAME }}/${{ matrix.name }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
Expand Down

0 comments on commit c9723cc

Please sign in to comment.