This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (102 loc) · 4.06 KB
/
jupyter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Jupyter Docker Build
on:
workflow_dispatch:
repository_dispatch:
types: [Jupyter_Update_Action]
jobs:
Jupyter_Docker_Build:
name: Jupyter Docker Build
runs-on: ubuntu-latest
steps:
-
name: Private Actions Checkout
uses: actions/checkout@v2.3.4
-
name: Docker Setup QEMU
uses: docker/setup-qemu-action@v1.2.0
-
name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.6.0
-
name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Docker Login in Aliyun
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKERHUB_REGISTRY_ALIYUN }}
username: ${{ secrets.DOCKERHUB_ACCOUNT_ALIYUN }}
password: ${{ secrets.DOCKERHUB_PASSWORD_ALIYUN }}
-
name: Docker Login in Gihtub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN_GITHUB }}
-
name: Build and push Docker images
uses: docker/build-push-action@v2.7.0
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
${{ secrets.DOCKERHUB_REGISTRY_ALIYUN }}/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:cache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:cache,mode=max
-
name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}
-
name: Hock Vercel Web Build
run: |
curl -s ${{ secrets.WebHock }}
-
name: Get Data
id: getDingData
run: |
set -ex
# 输出仓库名
REPOSITORY="${{GITHUB.REPOSITORY}}"
echo "REPOSITORY=${REPOSITORY#*/}" >> $GITHUB_OUTPUT
# 获取用户仓库信息
# RESPONSE="$(curl -sLm 10 https://api.github.com/repos/${{ GITHUB.REPOSITORY }})"
# 建议填写自己的 TOKEN
RESPONSE="$(curl -sLm 10 https://api.github.com/repos/${{ GITHUB.REPOSITORY }} -H "Authorization: token ${{ SECRETS.TOKEN_GITHUB }}")"
# 获取 用户仓库 设置的 描述,如果为空,可能是没有使用 TOKEN
DESCRIPTION="$(jq -r .description <(echo ${RESPONSE}))"
echo "DESCRIPTION=${DESCRIPTION}" >> $GITHUB_OUTPUT
# 获取 用户仓库 设置的 URL, 如果没有就输出 Github 地址
URL="$(jq -r .homepage <(echo ${RESPONSE}))"
if [[ "${URL}" == "null" || "${URL}" == "" ]]; then
echo "URL=${{ GITHUB.SERVER_URL }}/${{ GITHUB.REPOSITORY }}" >> $GITHUB_OUTPUT
else
echo "URL=${URL}" >> $GITHUB_OUTPUT
fi
-
name: Send dingding notify
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ SECRETS.DING_TOKEN }}
secret: ${{ SECRETS.DING_SECRET }}
body: |
{
"msgtype": "link",
"link": {
"text": "${{ steps.getDingData.outputs.DESCRIPTION }}",
"title": "${{ steps.getDingData.outputs.REPOSITORY }} WorkFlow ${{ GITHUB.JOB }} Success!",
"picUrl": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"messageUrl": "${{ steps.getDingData.outputs.URL }}"
}
}