9
9
default : ' '
10
10
11
11
env :
12
- ALIYUN_REGISTRY : " registry.cn-hangzhou.aliyuncs.com "
12
+ ALIYUN_REGISTRY : " ${{ secrets.DOCKER_REGISTRY_ALIYUN }} "
13
13
ALIYUN_REGISTRY_USER : " ${{ secrets.DOCKER_USERNAME_ALIYUN }}"
14
14
ALIYUN_REGISTRY_PASSWORD : " ${{ secrets.DOCKER_PASSWORD_ALIYUN }}"
15
15
@@ -18,53 +18,53 @@ jobs:
18
18
name : Push Docker image to Docker Hub
19
19
runs-on : ubuntu-latest
20
20
permissions :
21
- packages : write
22
- contents : read
23
- attestations : write
24
- id-token : write
21
+ packages : write
22
+ contents : read
23
+ attestations : write
24
+ id-token : write
25
25
steps :
26
- - name : Check out the repo
27
- uses : actions/checkout@v4
26
+ - name : Check out the repo
27
+ uses : actions/checkout@v4
28
28
29
- - name : Log in to Docker Hub
30
- uses : docker/login-action@v2
31
- with :
32
- username : ${{ secrets.DOCKER_USERNAME }}
33
- password : ${{ secrets.DOCKER_PASSWORD }}
29
+ - name : Log in to Docker Hub
30
+ uses : docker/login-action@v2
31
+ with :
32
+ username : ${{ secrets.DOCKER_USERNAME }}
33
+ password : ${{ secrets.DOCKER_PASSWORD }}
34
34
35
- - name : Extract metadata (tags, labels) for Docker
36
- id : meta
37
- uses : docker/metadata-action@v4
38
- with :
39
- images : answerhuang/fabulove
35
+ - name : Extract metadata (tags, labels) for Docker
36
+ id : meta
37
+ uses : docker/metadata-action@v4
38
+ with :
39
+ images : answerhuang/fabulove
40
40
41
- - name : Set current timestamp
42
- id : timestamp
43
- run : echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
41
+ - name : Set current timestamp
42
+ id : timestamp
43
+ run : echo "TIMESTAMP=$(date +%s)" >> $GITHUB_ENV
44
44
45
- - name : Set default image tag if not provided
46
- if : ${{ github.event.inputs.image_tag == '' }}
47
- run : echo "IMAGE_TAG=${{ env.TIMESTAMP }}" >> $GITHUB_ENV
45
+ - name : Set default image tag if not provided
46
+ if : ${{ github.event.inputs.image_tag == '' }}
47
+ run : echo "IMAGE_TAG=${{ env.TIMESTAMP }}" >> $GITHUB_ENV
48
48
49
- - name : Build and push Docker image
50
- id : push
51
- uses : docker/build-push-action@v3
52
- with :
53
- context : .
54
- file : ./docker/Dockerfile
55
- push : true
56
- tags : answerhuang/fabulove:${{ github.event.inputs.image_tag }}
57
- labels : ${{ steps.meta.outputs.labels }}
58
- - name : Rename
59
- id : rename
60
- run : docker tag answerhuang/fabulove:${{ github.event.inputs.image_tag }} $ALIYUN_REGISTRY/great_free/fabulove:${{ github.event.inputs.image_tag }}
61
- - name : Login Aliyun
62
- id : login
63
- run : |
64
- echo $ALIYUN_REGISTRY_USER
65
- echo $ALIYUN_REGISTRY_PASSWORD
66
- echo $ALIYUN_REGISTRY
67
- docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY
68
- - name : Push to Aliyun
69
- id : push_aliyun
70
- run : docker push registry.cn-hangzhou.aliyuncs.com/great_free/fabulove:${{ github.event.inputs.image_tag }}
49
+ - name : Build and push Docker image
50
+ id : push
51
+ uses : docker/build-push-action@v3
52
+ with :
53
+ context : .
54
+ file : ./docker/Dockerfile
55
+ push : true
56
+ tags : answerhuang/fabulove:${{ github.event.inputs.image_tag }}
57
+ labels : ${{ steps.meta.outputs.labels }}
58
+ - name : Rename
59
+ id : rename
60
+ run : docker tag answerhuang/fabulove:${{ github.event.inputs.image_tag }} $ALIYUN_REGISTRY/great_free/fabulove:${{ github.event.inputs.image_tag }}
61
+ - name : Login Aliyun
62
+ id : login
63
+ run : |
64
+ echo $ALIYUN_REGISTRY_USER
65
+ echo $ALIYUN_REGISTRY_PASSWORD
66
+ echo $ALIYUN_REGISTRY
67
+ docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY
68
+ - name : Push to Aliyun
69
+ id : push_aliyun
70
+ run : docker push registry.cn-hangzhou.aliyuncs.com/great_free/fabulove:${{ github.event.inputs.image_tag }}
0 commit comments