Skip to content

On Demand (Manual) Docker Image Build #25

On Demand (Manual) Docker Image Build

On Demand (Manual) Docker Image Build #25

name: On Demand (Manual) Docker Image Build
env:
DOCKERHUB_USER_NAME: ${{ secrets.DOCKERHUB_USER_NAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
on:
workflow_dispatch:
inputs:
trigger_type:
description: "Type of build which you want to trigger. Allowed values: main, tags, nightly"
required: true
tag_name:
description: "The tag name on the project repo to be released. It is mandatory if you select the trigger_type as 'tags'"
required: false
default: ""
jobs:
build_and_publish_images:
name: Build and publish images
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Clone tools branch
run: git clone -b release-13.0 --depth=1 https://github.com/citusdata/tools.git tools
- name: Install package dependencies
run: sudo apt-get update && sudo apt install libcurl4-openssl-dev libssl-dev python3-testresources
- name: Install python requirements
run: python -m pip install -r tools/packaging_automation/requirements.txt
- name: DockerHub Login
run: docker login -u "${DOCKERHUB_USER_NAME}" -p "${DOCKERHUB_PASSWORD}"
- name: Build and publish docker images
run: |
python -m tools.packaging_automation.publish_docker \
--pipeline_trigger_type "${GITHUB_EVENT_NAME}" \
--tag_name "${{ github.event.inputs.tag_name }}" \
--manual_trigger_type "${{ github.event.inputs.trigger_type }}" \
--github_ref "${GITHUB_REF}"