ci: Try to push to ghcr.io (#2051)

I don't think I can change where it's pushed and start using it in the
same PR, so will try to first update the push part, and then change
where the image is used. Only doing it for CI image to not break
anything.
This commit is contained in:
Ayaz Salikhov
2025-04-28 19:04:22 +01:00
committed by GitHub
parent b03cd63efd
commit de43be887e
3 changed files with 18 additions and 6 deletions

View File

@@ -1,8 +1,12 @@
name: Build and push Docker image
description: Build and push Docker image to DockerHub and GitHub Container Registry
inputs:
image_name:
description: Name of the image to build
images:
description: Name of the images to use as a base name
required: true
dockerhub_repo:
description: DockerHub repository name
required: true
push_image:
description: Whether to push the image to the registry (true/false)
@@ -19,6 +23,7 @@ inputs:
description:
description: Short description of the image
required: true
runs:
using: composite
steps:
@@ -45,7 +50,7 @@ runs:
- uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 #v5.7.0
id: meta
with:
images: ${{ inputs.image_name }}
images: ${{ inputs.images }}
tags: ${{ inputs.tags }}
- name: Build and push
@@ -62,6 +67,6 @@ runs:
with:
username: ${{ env.DOCKERHUB_USER }}
password: ${{ env.DOCKERHUB_PW }}
repository: ${{ inputs.image_name }}
repository: ${{ inputs.dockerhub_repo }}
short-description: ${{ inputs.description }}
readme-filepath: ${{ inputs.directory }}/README.md

View File

@@ -87,7 +87,10 @@ jobs:
DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
image_name: rippleci/clio
images: |
rippleci/clio
ghcr.io/xrplf/clio
dockerhub_repo: rippleci/clio
push_image: ${{ inputs.publish_image }}
directory: docker/clio
tags: ${{ inputs.tags }}

View File

@@ -1,4 +1,5 @@
name: Update CI docker image
on:
pull_request:
paths:
@@ -29,7 +30,10 @@ jobs:
DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
image_name: rippleci/clio_ci
images: |
rippleci/clio_ci
ghcr.io/xrplf/clio-ci
dockerhub_repo: rippleci/clio_ci
push_image: ${{ github.event_name != 'pull_request' }}
directory: docker/ci
tags: |