diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66f1b2e..fb7688e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,6 @@ on: branches: [ main ] env: - REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: @@ -21,8 +20,10 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image + images: | + ${{ secrets.DOCKER_ORGANIZATION }}/${{ env.IMAGE_NAME }} + ${{ vars.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }} + - name: Build image uses: docker/build-push-action@v6 with: context: . diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b3d9feb..f4a7aee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,13 +5,11 @@ on: types: [published] env: - REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: push_to_registry: - name: Push image to GitHub container registry - + name: Push image to registries runs-on: ubuntu-latest permissions: contents: read @@ -19,12 +17,19 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v5 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + registry: ${{ vars.DOCKER_REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} - - name: Login to the container registry + - name: Login to GitHub registry uses: docker/login-action@v3 with: - registry: ${{ env.REGISTRY }} + registry: ${{ vars.REGISTRY_GITHUB }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -38,9 +43,11 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: | + ${{ secrets.DOCKER_ORGANIZATION }}/${{ env.IMAGE_NAME }} + ${{ vars.REGISTRY_GITHUB }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image + - name: Build and push image uses: docker/build-push-action@v6 with: context: . @@ -48,3 +55,10 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64, linux/arm64 + + - name: Update DockerHub repository description + uses: peter-evans/dockerhub-description@v5 + with: + repository: ${{ secrets.DOCKER_ORGANIZATION }}/${{ env.IMAGE_NAME }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }}