File tree Expand file tree Collapse file tree 1 file changed +40
-3
lines changed Expand file tree Collapse file tree 1 file changed +40
-3
lines changed Original file line number Diff line number Diff line change 1- name : Upload Python Package to PyPI when a Release is Created
2-
1+ name : Upload Python Package and Docker Image on Release
32on :
43 release :
54 types : [created]
2524 pip install setuptools wheel
2625 - name : Build package
2726 run : |
28- python setup.py sdist bdist_wheel # Could also be python -m build
27+ python setup.py sdist bdist_wheel
2928 - name : Publish package distributions to PyPI
3029 uses : pypa/gh-action-pypi-publish@release/v1
30+
31+ docker-publish :
32+ name : Publish Docker image
33+ runs-on : ubuntu-latest
34+ needs : pypi-publish
35+ permissions :
36+ contents : read
37+ packages : write
38+ steps :
39+ - uses : actions/checkout@v4
40+
41+ - name : Set up Docker Buildx
42+ uses : docker/setup-buildx-action@v3
43+
44+ - name : Log in to GitHub Container Registry
45+ uses : docker/login-action@v3
46+ with :
47+ registry : ghcr.io
48+ username : ${{ github.actor }}
49+ password : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - name : Extract metadata for Docker
52+ id : meta
53+ uses : docker/metadata-action@v5
54+ with :
55+ images : ghcr.io/${{ github.repository }}
56+ tags : |
57+ type=semver,pattern={{version}}
58+ type=semver,pattern={{major}}.{{minor}}
59+ latest
60+
61+ - name : Build and push Docker image
62+ uses : docker/build-push-action@v5
63+ with :
64+ context : .
65+ push : true
66+ tags : ${{ steps.meta.outputs.tags }}
67+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments