Publish Dependency Image #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Dependency Image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| os_type: | |
| description: 'Operating System' | |
| required: true | |
| default: 'centos' | |
| type: choice | |
| options: | |
| - centos | |
| - ubuntu | |
| architecture: | |
| description: 'Architecture' | |
| required: true | |
| default: 'arm64' | |
| type: choice | |
| options: | |
| - arm64 | |
| - amd64 | |
| tag_suffix: | |
| description: 'Additional tag suffix (optional)' | |
| required: false | |
| type: string | |
| env: | |
| ORG: ${{ github.repository_owner }} | |
| ARCH: ${{ inputs.architecture }} | |
| DOCKER_CMD: docker | |
| NUM_THREADS: 2 | |
| jobs: | |
| build-and-push: | |
| name: Build and Push Dependency Image | |
| runs-on: ${{ inputs.architecture == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
| steps: | |
| - name: Checkout presto | |
| run: | | |
| git clone --depth 1 https://github.com/prestodb/presto.git | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| path: presto/presto-dev | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.DOCKER_TOKEN }} | |
| - name: Get version information | |
| id: version | |
| run: | | |
| cd presto/presto-native-execution | |
| make submodules | |
| - name: Build dependency image | |
| run: | | |
| cd presto/presto-dev | |
| make ${{ inputs.os_type }}-dep | |
| - name: Tag and push images | |
| run: | | |
| cd presto/presto-dev | |
| # Define image names | |
| DEP_IMAGE="docker.io/${{ env.ORG }}/prestissimo-dependency:${{ inputs.os_type == 'ubuntu' && 'ubuntu-22.04' || 'centos9' }}" | |
| VERSION_TAG="${DEP_IMAGE}-${{ steps.version.outputs.VERSION }}-${{ steps.version.outputs.COMMIT_ID }}-${{ inputs.architecture }}" | |
| LATEST_TAG="${DEP_IMAGE}-latest-${{ inputs.architecture }}" | |
| # Add custom tag if provided | |
| if [ -n "${{ inputs.tag_suffix }}" ]; then | |
| CUSTOM_TAG="${DEP_IMAGE}-${{ inputs.tag_suffix }}-${{ inputs.architecture }}" | |
| docker tag "presto/prestissimo-dependency:${{ inputs.os_type == 'ubuntu' && 'ubuntu-22.04' || 'centos9' }}" "${CUSTOM_TAG}" | |
| docker push "${CUSTOM_TAG}" | |
| echo "Pushed custom tag: ${CUSTOM_TAG}" | |
| fi | |
| # Tag with version and latest | |
| docker tag "presto/prestissimo-dependency:${{ inputs.os_type == 'ubuntu' && 'ubuntu-22.04' || 'centos9' }}" "${VERSION_TAG}" | |
| docker tag "presto/prestissimo-dependency:${{ inputs.os_type == 'ubuntu' && 'ubuntu-22.04' || 'centos9' }}" "${LATEST_TAG}" | |
| # Push images | |
| docker push "${VERSION_TAG}" | |
| docker push "${LATEST_TAG}" | |
| echo "Pushed version tag: ${VERSION_TAG}" | |
| echo "Pushed latest tag: ${LATEST_TAG}" |