@@ -12,42 +12,48 @@ jobs:
12
12
runs-on : ubuntu-latest
13
13
steps :
14
14
- name : checkout
15
- uses : actions/checkout@v2
15
+ uses : actions/checkout@v3
16
16
with :
17
17
fetch-depth : 0
18
18
19
- - name : build and push to github packages
20
- uses : docker/build-push -action@v1
19
+ - name : Log in to the ghcr
20
+ uses : docker/login -action@v1
21
21
with :
22
22
registry : ghcr.io
23
23
username : ${{ github.actor }}
24
24
password : ${{ secrets.GITHUB_TOKEN }}
25
- tag_with_ref : true
26
- tag_with_sha : false
27
25
28
- - name : build and push to docker hub
29
- uses : docker/build-push -action@v1
26
+ - name : Log in to the docker
27
+ uses : docker/login -action@v1
30
28
with :
31
- repository : projecteru2/core
32
29
username : ${{ secrets.DOCKER_USERNAME }}
33
30
password : ${{ secrets.DOCKER_PASSWORD }}
34
- tag_with_ref : true
35
- tag_with_sha : false
36
31
37
- - name : " [debug version] build and push to docker hub"
38
- uses : docker/build-push-action@v1
32
+ - name : Docker meta
33
+ id : meta
34
+ uses : docker/metadata-action@v3
39
35
with :
40
- build_args : KEEP_SYMBOL=1
41
- repository : projecteru2/core
42
- username : ${{ secrets.DOCKER_USERNAME }}
43
- password : ${{ secrets.DOCKER_PASSWORD }}
44
- tags : ${{ github.sha }}-debug
36
+ images : |
37
+ ${{ github. repository }}
38
+ ghcr.io/ ${{ github.repository }}
39
+ tags : |
40
+ type=ref,event=tag
45
41
46
- - name : " [debug version] build and push to github packages"
47
- uses : docker/build-push-action@v1
42
+ - name : Build and push image
43
+ if : ${{ steps.meta.outputs.tags != '' }}
44
+ uses : docker/build-push-action@v2
48
45
with :
49
- registry : ghcr.io
50
- username : ${{ github.actor }}
51
- password : ${{ secrets.GITHUB_TOKEN }}
52
- build_args : KEEP_SYMBOL=1
53
- tags : ${{ github.sha }}-debug
46
+ context : " ."
47
+ push : true
48
+ tags : ${{ steps.meta.outputs.tags }}
49
+
50
+ - name : " [debug version] Build and push image"
51
+ uses : docker/build-push-action@v2
52
+ with :
53
+ context : " ."
54
+ push : true
55
+ build_args : |
56
+ KEEP_SYMBOL=1
57
+ tags : |
58
+ ${{ github.repository }}:${{ github.sha }}-debug
59
+ ghcr.io/${{ github.repository }}:${{ github.sha }}-debug
0 commit comments