|
53 | 53 | run: make upload-to-pypi |
54 | 54 | env: |
55 | 55 | PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
| 56 | + |
| 57 | + push_to_docker_hub: |
| 58 | + name: "Push To Docker Hub" |
| 59 | + needs: run_checks |
| 60 | + runs-on: "ubuntu-latest" |
| 61 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v2 |
| 64 | + |
| 65 | + - name: Set Up Docker Buildx |
| 66 | + id: buildx |
| 67 | + uses: docker/setup-buildx-action@v1 |
| 68 | + |
| 69 | + - name: Build the image |
| 70 | + run: make docker-image |
| 71 | + |
| 72 | + - name: Login To DockerHub |
| 73 | + uses: docker/login-action@v1 |
| 74 | + with: |
| 75 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 76 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 77 | + |
| 78 | + - name: Docker Meta |
| 79 | + id: docker_meta |
| 80 | + uses: docker/metadata-action@v3 |
| 81 | + with: |
| 82 | + images: enapter/python-sdk |
| 83 | + tags: | |
| 84 | + type=raw,value=${{ github.ref_name }} |
| 85 | +
|
| 86 | + - name: Build And Push To DockerHub |
| 87 | + uses: docker/build-push-action@v2 |
| 88 | + with: |
| 89 | + context: . |
| 90 | + push: true |
| 91 | + tags: ${{ steps.docker_meta.outputs.tags }} |
| 92 | + labels: ${{ steps.docker_meta.outputs.labels }} |
| 93 | + |
| 94 | + push_to_enapter_docker_hub: |
| 95 | + name: "Push To Enapter Docker Hub" |
| 96 | + needs: run_checks |
| 97 | + runs-on: "ubuntu-latest" |
| 98 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v2 |
| 101 | + |
| 102 | + - name: Set Up Docker Buildx |
| 103 | + id: buildx |
| 104 | + uses: docker/setup-buildx-action@v1 |
| 105 | + |
| 106 | + - name: Build The Image |
| 107 | + run: make docker-image |
| 108 | + |
| 109 | + - name: Login To DockerHub |
| 110 | + uses: docker/login-action@v1 |
| 111 | + with: |
| 112 | + registry: docker.enapter.com |
| 113 | + username: ${{ secrets.ENAPTER_DOCKERHUB_USERNAME }} |
| 114 | + password: ${{ secrets.ENAPTER_DOCKERHUB_TOKEN }} |
| 115 | + |
| 116 | + - name: Docker Meta |
| 117 | + id: enapter_docker_meta |
| 118 | + uses: docker/metadata-action@v3 |
| 119 | + with: |
| 120 | + images: docker.enapter.com/python/sdk |
| 121 | + tags: | |
| 122 | + type=raw,value=${{ github.ref_name }} |
| 123 | +
|
| 124 | + - name: Build And Push To DockerHub |
| 125 | + uses: docker/build-push-action@v2 |
| 126 | + with: |
| 127 | + context: . |
| 128 | + push: true |
| 129 | + tags: ${{ steps.enapter_docker_meta.outputs.tags }} |
| 130 | + labels: ${{ steps.enapter_docker_meta.outputs.labels }} |
0 commit comments