forked from yaming116/docker-pull-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1 KB
/
docker.yaml
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
name: Docker
on:
push:
branches: [ main ]
# pull_request:
# branches: [ main ]
env:
REGISTRY: registry.cn-shenzhen.aliyuncs.com
ALIYUN_REGISTRY_USER: "${{ secrets.ALIYUN_REGISTRY_USER }}"
ALIYUN_REGISTRY_PASSWORD: "${{ secrets.ALIYUN_REGISTRY_PASSWORD }}"
MM_NOTIFY_URL: "${{ secrets.MM_NOTIFY_URL }}"
jobs:
build:
name: Pull
runs-on: ubuntu-latest
steps:
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
- name: Check out code
uses: actions/checkout@v2
- name: Build and push image to ACR EE
run: |
docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $REGISTRY
sh pull.sh
data=`cat trigger.txt`
if [ $MM_NOTIFY_URL ];then
curl -H 'Content-Type: application/json' \
-d "{\"msgtype\": \"text\",\"text\": {\"content\":\"同步成功 $data \"}}" \
$MM_NOTIFY_URL
else
echo 'MM_NOTIFY_URL not set'
fi