mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 11:55:51 +00:00 
			
		
		
		
	Bumps [actions/checkout](https://github.com/actions/checkout) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08eba0b27e...08c6903cd8)
---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
		
	
		
			
				
	
	
		
			110 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			110 lines
		
	
	
		
			3.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
name: Build and publish Clio docker image
 | 
						|
 | 
						|
on:
 | 
						|
  workflow_call:
 | 
						|
    inputs:
 | 
						|
      tags:
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
        description: Comma separated tags for docker image
 | 
						|
      artifact_name:
 | 
						|
        type: string
 | 
						|
        description: Name of Github artifact to put into docker image
 | 
						|
      strip_binary:
 | 
						|
        type: boolean
 | 
						|
        description: Whether to strip clio binary
 | 
						|
        default: true
 | 
						|
      publish_image:
 | 
						|
        type: boolean
 | 
						|
        description: Whether to publish docker image
 | 
						|
        required: true
 | 
						|
 | 
						|
  workflow_dispatch:
 | 
						|
    inputs:
 | 
						|
      tags:
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
        description: Comma separated tags for docker image
 | 
						|
      clio_server_binary_url:
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
        description: Url to download clio_server binary from
 | 
						|
      binary_sha256:
 | 
						|
        required: true
 | 
						|
        type: string
 | 
						|
        description: sha256 hash of the binary
 | 
						|
      strip_binary:
 | 
						|
        type: boolean
 | 
						|
        description: Whether to strip clio binary
 | 
						|
        default: true
 | 
						|
 | 
						|
jobs:
 | 
						|
  build_and_publish_image:
 | 
						|
    name: Build and publish image
 | 
						|
    runs-on: ubuntu-latest
 | 
						|
 | 
						|
    steps:
 | 
						|
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
 | 
						|
 | 
						|
      - name: Download Clio binary from artifact
 | 
						|
        if: ${{ inputs.artifact_name != null }}
 | 
						|
        uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
 | 
						|
        with:
 | 
						|
          name: ${{ inputs.artifact_name }}
 | 
						|
          path: ./docker/clio/artifact/
 | 
						|
 | 
						|
      - name: Download Clio binary from url
 | 
						|
        if: ${{ inputs.clio_server_binary_url != null }}
 | 
						|
        shell: bash
 | 
						|
        env:
 | 
						|
          BINARY_URL: ${{ inputs.clio_server_binary_url }}
 | 
						|
          BINARY_SHA256: ${{ inputs.binary_sha256 }}
 | 
						|
        run: |
 | 
						|
          wget "${BINARY_URL}" -P ./docker/clio/artifact/
 | 
						|
          if [ "$(sha256sum ./docker/clio/clio_server | awk '{print $1}')" != "${BINARY_SHA256}" ]; then
 | 
						|
            echo "Binary sha256 sum doesn't match"
 | 
						|
            exit 1
 | 
						|
          fi
 | 
						|
      - name: Unpack binary
 | 
						|
        shell: bash
 | 
						|
        run: |
 | 
						|
          sudo apt update && sudo apt install -y tar unzip
 | 
						|
          cd docker/clio/artifact
 | 
						|
          artifact=$(find . -type f)
 | 
						|
          if [[ $artifact == *.zip ]]; then
 | 
						|
            unzip $artifact
 | 
						|
          elif [[ $artifact == *.tar.gz ]]; then
 | 
						|
            tar -xvf $artifact
 | 
						|
          fi
 | 
						|
          chmod +x ./clio_server
 | 
						|
          mv ./clio_server ../
 | 
						|
          cd ../
 | 
						|
          rm -rf ./artifact
 | 
						|
 | 
						|
      - name: Strip binary
 | 
						|
        if: ${{ inputs.strip_binary }}
 | 
						|
        shell: bash
 | 
						|
        run: strip ./docker/clio/clio_server
 | 
						|
 | 
						|
      - name: Set GHCR_REPO
 | 
						|
        id: set-ghcr-repo
 | 
						|
        run: |
 | 
						|
          echo "GHCR_REPO=$(echo ghcr.io/${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_OUTPUT}
 | 
						|
 | 
						|
      - name: Build Docker image
 | 
						|
        uses: ./.github/actions/build-docker-image
 | 
						|
        env:
 | 
						|
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
						|
          DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
 | 
						|
          DOCKERHUB_PW: ${{ secrets.DOCKERHUB_PW }}
 | 
						|
        with:
 | 
						|
          images: |
 | 
						|
            ghcr.io/${{ steps.set-ghcr-repo.outputs.GHCR_REPO }}/clio
 | 
						|
            ${{ github.repository_owner == 'XRPLF' && 'rippleci/clio' || '' }}
 | 
						|
          push_image: ${{ inputs.publish_image }}
 | 
						|
          directory: docker/clio
 | 
						|
          tags: ${{ inputs.tags }}
 | 
						|
          platforms: linux/amd64
 | 
						|
          dockerhub_repo: ${{ github.repository_owner == 'XRPLF' && 'rippleci/clio' || '' }}
 | 
						|
          dockerhub_description: Clio is an XRP Ledger API server.
 |