1010 runs-on : ubuntu-latest
1111 env :
1212 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
13+ DOCKER_REGISTRY : hub.docker.com
14+ DOCKER_IMAGE_NAME : ${{ github.repository }}
1315 steps :
1416 - name : Check out the repo
1517 uses : actions/checkout@v2
2123 with :
2224 install : true
2325
26+ - name : Log in to the registry
27+ uses : docker/login-action@v1
28+ with :
29+ registry : ${{ env.DOCKER_REGISTRY }}
30+ username : ${{ secrets.DOCKER_USERNAME }}
31+ password : ${{ secrets.DOCKER_PASSWORD }}
32+
33+ - name : Set up metadata
34+ id : meta
35+ uses : docker/metadata-action@v3
36+ with :
37+ images : ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
38+ tags : |
39+ type=pep440,pattern={{version}}
40+ type=pep440,pattern={{major}}
41+ type=pep440,pattern={{major}}.{{minor}}
42+
43+ - name : Set up metadata (-pytezos)
44+ id : meta-pytezos
45+ uses : docker/metadata-action@v3
46+ with :
47+ images : ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
48+ tags : |
49+ type=pep440,pattern={{version}}-pytezos
50+ type=pep440,pattern={{major}}-pytezos
51+ type=pep440,pattern={{major}}.{{minor}}-pytezos
52+
2453 - name : Set up Python
2554 uses : actions/setup-python@v2
2655 with :
@@ -38,37 +67,24 @@ jobs:
3867 - name : Run tests
3968 run : make test
4069
41- - name : Generate semver labels
42- 43- id : version
70+ - name : Publish image on Docker Hub
71+ uses : docker/build-push-action@v2
4472 with :
45- tag_prefix : " "
46- format : " ${major}.${minor}.${patch}"
73+ context : .
74+ file : Dockerfile
75+ push : true
76+ tags : ${{ steps.meta.outputs.tags }}
77+ labels : ${{ steps.meta.outputs.labels }}
4778
48- - name : Set up enviroment
49- run : |
50- echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
51- echo ::set-env name=MAJOR_VERSION::${{ steps.version.outputs.major }}
52- echo ::set-env name=MINOR_VERSION::${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}
53-
54- - name : Publish Docker image
55- uses : elgohr/Publish-Docker-Github-Action@master
56- with :
57- name : dipdup/dipdup
58- username : ${{ secrets.DOCKER_USERNAME }}
59- password : ${{ secrets.DOCKER_PASSWORD }}
60- tags : " ${{ env.RELEASE_VERSION }},${{ env.MAJOR_VERSION }},${{ env.MINOR_VERSION }}"
61-
62- - name : Publish Docker image (-pytezos)
63- uses : elgohr/Publish-Docker-Github-Action@master
64- env :
65- EXTRAS : pytezos
79+ - name : Publish image on Docker Hub (-pytezos)
80+ uses : docker/build-push-action@v2
6681 with :
67- name : dipdup/dipdup
68- username : ${{ secrets.DOCKER_USERNAME }}
69- password : ${{ secrets.DOCKER_PASSWORD }}
70- tags : " ${{ env.RELEASE_VERSION }}-pytezos,${{ env.MAJOR_VERSION }}-pytezos,${{ env.MINOR_VERSION }}-pytezos"
71- buildargs : EXTRAS
82+ context : .
83+ file : Dockerfile
84+ push : true
85+ tags : ${{ steps.meta-pytezos.outputs.tags }}
86+ labels : ${{ steps.meta-pytezos.outputs.labels }}
87+ build-args : EXTRAS=pytezos
7288
7389 - name : Publish package on PyPi
7490 run : |
0 commit comments