diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7088d5d..16a90c2 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,6 +7,10 @@ on: - 'main' tags: - 'v*' + +env: + REGISTRY: ghcr.io + jobs: build: @@ -21,7 +25,7 @@ jobs: id: docker_meta uses: docker/metadata-action@v5 with: - images: stephanme/modbus_exporter + images: ${{ env.REGISTRY }}/stephanme/modbus_exporter tags: | type=schedule type=ref,event=pr @@ -36,8 +40,9 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: diff --git a/README.md b/README.md index d5cde38..a1832f4 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ Sample access with port forwarding: ## Build -The images are built and pushed to dockerhub by a github action. +The images are built and pushed to ghcr.io by a github action. Manual local build: ``` -docker build -t stephanme/modbus_exporter . +docker build -t ghcr.io/stephanme/modbus_exporter . # full rebuild (update base image and chrome) -docker build --pull --no-cache -t stephanme/modbus_exporter . +docker build --pull --no-cache -t ghcr.io/stephanme/modbus_exporter . ``` ## Release diff --git a/modbus-exporter-example.yaml b/modbus-exporter-example.yaml index 5efa981..f750494 100644 --- a/modbus-exporter-example.yaml +++ b/modbus-exporter-example.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: modbus-exporter - image: stephanme/modbus_exporter:latest + image: ghcr.io/stephanme/modbus_exporter:latest ports: - containerPort: 9602 command: