Skip to content

Commit 8adc4cd

Browse files
committed
adds pushrm to gitbub steps
1 parent 527c16c commit 8adc4cd

1 file changed

Lines changed: 42 additions & 24 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches:
88
- development
99
paths:
10+
- .github/**
1011
- module/**
1112
- netbox-sync.py
1213
- requirements.txt
@@ -36,30 +37,38 @@ jobs:
3637
with:
3738
string: ${{ github.repository }}
3839

39-
- name: Log in to GitHub Container Registry
40-
uses: docker/login-action@v3
41-
with:
42-
registry: ghcr.io
43-
username: ${{ github.actor }}
44-
password: ${{ secrets.GITHUB_TOKEN }}
45-
46-
- name: Docker meta GitHub Container Registry
47-
id: meta
48-
uses: docker/metadata-action@v5
40+
- name: set dockerhub repo name
41+
uses: mad9000/actions-find-and-replace-string@5
42+
id: dockerhub_image
4943
with:
50-
images: ghcr.io/${{ steps.docker_image.outputs.lowercase }}
51-
tags: |
52-
type=semver,pattern={{version}}
53-
type=ref,event=branch
44+
source: ${{ steps.docker_image.outputs.lowercase }}
45+
find: 'bb-ricardo'
46+
replace: 'bbricardo'
5447

55-
- name: Build and push with tags - ${{ steps.meta.outputs.tags }}
56-
uses: docker/build-push-action@v6
57-
with:
58-
context: .
59-
push: true
60-
platforms: linux/amd64,linux/arm64
61-
tags: ${{ steps.meta.outputs.tags }}
62-
labels: ${{ steps.meta.outputs.labels }}
48+
# - name: Log in to GitHub Container Registry
49+
# uses: docker/login-action@v3
50+
# with:
51+
# registry: ghcr.io
52+
# username: ${{ github.actor }}
53+
# password: ${{ secrets.GITHUB_TOKEN }}
54+
#
55+
# - name: Docker meta GitHub Container Registry
56+
# id: meta
57+
# uses: docker/metadata-action@v5
58+
# with:
59+
# images: ghcr.io/${{ steps.docker_image.outputs.lowercase }}
60+
# tags: |
61+
# type=semver,pattern={{version}}
62+
# type=ref,event=branch
63+
#
64+
# - name: Build and push with tags - ${{ steps.meta.outputs.tags }}
65+
# uses: docker/build-push-action@v6
66+
# with:
67+
# context: .
68+
# push: true
69+
# platforms: linux/amd64,linux/arm64
70+
# tags: ${{ steps.meta.outputs.tags }}
71+
# labels: ${{ steps.meta.outputs.labels }}
6372

6473
- name: Log in to Docker Hub
6574
uses: docker/login-action@v3
@@ -71,16 +80,25 @@ jobs:
7180
id: meta_dhub
7281
uses: docker/metadata-action@v5
7382
with:
74-
images: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.docker_image.outputs.lowercase }}
83+
images: docker.io/${{ steps.dockerhub_image.outputs.value }}
7584
tags: |
7685
type=semver,pattern={{version}}
7786
type=ref,event=branch
7887
79-
- name: Build and push with tags - ${{ steps.meta_dhub.outputs.tags }}
88+
- name: Build and push with tags - ${{ steps.dockerhub_image.outputs.value }}
8089
uses: docker/build-push-action@v6
8190
with:
8291
context: .
8392
push: true
8493
platforms: linux/amd64,linux/arm64
8594
tags: ${{ steps.meta_dhub.outputs.tags }}
8695
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: ${{ secrets.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

Comments
 (0)