Skip to content

Patches description and overview to DockerHub

License

Notifications You must be signed in to change notification settings

kei-g/dockerhub-patch

kei-g/dockerhub-patch License

kei-g/dockerhub-patch

kei-g/dockerhub-patch - Patches description and overview to DockerHub.

CI Status

Workflow Name Status
Build GitHub CI (Build)
CodeQL GitHub CI (CodeQL)
Coverage GitHub CI (Coverage)

Action Inputs

Input name Description Required
description Single-line description of your docker image. true
overview Full-text description of your docker image. If absent, the content of 'README.md' will be used as this. false
password Your PAT or password on DockerHub. PATs are recommended to be specified rather than passwords. true
repo Repository name of your docker image. true
username Your name on DockerHub. This field will be prepended to repo with '/'. true

Action Outputs

Output name Description
response The response from DockerHub.

Example

env:
  IMAGE_NAME: example
jobs:
  publish:
    if: github.ref_type == 'tag'
    name: Publish the docker image
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 1
          submodules: true
      - id: metadata
        name: Docker metadata
        uses: docker/metadata-action@v4
        with:
          images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
          tags: |
            type=semver,pattern={{major}}
            type=semver,pattern={{major}}.{{minor}}
            type=semver,pattern={{version}}
      - name: Setup Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          password: ${{ secrets.DOCKERHUB_TOKEN }}
          username: ${{ secrets.DOCKERHUB_USERNAME }}
      - name: Run Buildx and Push it to DockerHub
        uses: docker/build-push-action@v3
        with:
          context: .
          push: true
          tags: |
            ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
            ${{ steps.metadata.outputs.tags }}
      - name: Patch the description
        uses: kei-g/dockerhub-patch@main
        with:
          description: An example image.
          password: ${{ secrets.DOCKERHUB_TOKEN }}
          repo: ${{ env.IMAGE_NAME }}
          username: ${{ secrets.DOCKERHUB_USERNAME }}
name: Example
on:
  create:
    tags:
      - 'v[0-9]+(\.[0-9]+)*(\-[A-Za-z0-9]+)*'

License

The scripts and documentation in this project are released under the BSD-3-Clause License

Contributions

Contributions are welcome! See Contributor's Guide

Code of Conduct

👏 Be nice. See our code of conduct

About

Patches description and overview to DockerHub

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks