|
7 | 7 | branches: |
8 | 8 | - development |
9 | 9 | paths: |
| 10 | + - .github/** |
10 | 11 | - module/** |
11 | 12 | - netbox-sync.py |
12 | 13 | - requirements.txt |
|
36 | 37 | with: |
37 | 38 | string: ${{ github.repository }} |
38 | 39 |
|
| 40 | + - name: set dockerhub repo name |
| 41 | + uses: mad9000/actions-find-and-replace-string@5 |
| 42 | + id: dockerhub_image |
| 43 | + with: |
| 44 | + source: ${{ steps.docker_image.outputs.lowercase }} |
| 45 | + find: 'bb-ricardo' |
| 46 | + replace: ${{ vars.DOCKER_HUB_USERNAME }} |
| 47 | + |
39 | 48 | - name: Log in to GitHub Container Registry |
40 | 49 | uses: docker/login-action@v3 |
41 | 50 | with: |
@@ -64,23 +73,32 @@ jobs: |
64 | 73 | - name: Log in to Docker Hub |
65 | 74 | uses: docker/login-action@v3 |
66 | 75 | with: |
67 | | - username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 76 | + username: ${{ vars.DOCKER_HUB_USERNAME }} |
68 | 77 | password: ${{ secrets.DOCKER_HUB_PASSWORD }} |
69 | 78 |
|
70 | 79 | - name: Docker hub meta |
71 | 80 | id: meta_dhub |
72 | 81 | uses: docker/metadata-action@v5 |
73 | 82 | with: |
74 | | - images: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.docker_image.outputs.lowercase }} |
| 83 | + images: docker.io/${{ steps.dockerhub_image.outputs.value }} |
75 | 84 | tags: | |
76 | 85 | type=semver,pattern={{version}} |
77 | 86 | type=ref,event=branch |
78 | 87 |
|
79 | | - - name: Build and push with tags - ${{ steps.meta_dhub.outputs.tags }} |
| 88 | + - name: Build and push with tags - ${{ steps.dockerhub_image.outputs.value }} |
80 | 89 | uses: docker/build-push-action@v6 |
81 | 90 | with: |
82 | 91 | context: . |
83 | 92 | push: true |
84 | 93 | platforms: linux/amd64,linux/arm64 |
85 | 94 | tags: ${{ steps.meta_dhub.outputs.tags }} |
86 | 95 | labels: ${{ steps.meta_dhub.outputs.labels }} |
| 96 | + |
| 97 | + - name: push README to Dockerhub |
| 98 | + uses: christian-korneck/update-container-description-action@v1 |
| 99 | + env: |
| 100 | + DOCKER_USER: ${{ vars.DOCKER_HUB_USERNAME }} |
| 101 | + DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }} |
| 102 | + with: |
| 103 | + destination_container_repo: ${{ steps.dockerhub_image.outputs.value }} |
| 104 | + provider: dockerhub |
0 commit comments