-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-docker-manual.yml
71 lines (67 loc) · 2.81 KB
/
build-docker-manual.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This GitHub Actions workflow is designed to manually build and optionally push a Docker image to DockerHub.
#
# Workflow Name: build-docker-manual
#
# Inputs:
# - dockerfile: Path to the Dockerfile in the repository (e.g., common/ccbr_bwa/Dockerfile). This input is required.
# - dockerhub-namespace: DockerHub namespace or organization name (e.g., nciccbr). This input is required and defaults to 'nciccbr'.
# - push: Boolean flag to determine whether to push the built image to DockerHub. This input is required and defaults to 'false'.
#
# Jobs:
# - build-docker: This job runs on an Ubuntu latest runner and performs the following steps:
# - Checks out the repository.
# - Logs in to DockerHub if the 'push' input is set to 'true'.
# - Prepares build-time variables by running a custom script.
# - Checks variables and creates a temporary README file with build details.
# - Builds and optionally pushes the Docker image using the docker/build-push-action.
# - Lists Docker images on the runner.
# - Updates the DockerHub description with the contents of the temporary README file if the image was successfully pushed.
name: build-docker-manual
run-name: build-docker ${{ inputs.dockerfile }}-${{ inputs.suffix }}
on:
workflow_dispatch:
inputs:
dockerfile:
type: string
description: path to the Dockerfile in the repo (e.g. common/ccbr_bwa/Dockerfile)
required: true
dockerhub-namespace:
type: string
description: dockerhub namespace or org name (e.g. nciccbr)
required: true
default: nciccbr
suffix:
type: string
description: Suffix to add to image tag eg. "dev" to add "-dev"
required: true
default: feat
push:
type: boolean
description: Push to DockerHub (leave unchecked to just build the container without pushing)
required: true
default: false
ccbr-actions-version:
description: "The version of ccbr_actions to use"
required: true
default: "v0.2"
jobs:
build-docker:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v4
- uses: CCBR/actions/[email protected]
with:
dockerfile: ${{ github.event.inputs.dockerfile }}
dockerhub-namespace: ${{ github.event.inputs.dockerhub-namespace }}
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME_VK }}
dockerhub-token: ${{ secrets.DOCKERHUBRW_TOKEN_VK }}
suffix: ${{ github.event.inputs.suffix }}
push: ${{ github.event.inputs.push }}
ccbr-actions-version: ${{ github.event.inputs.ccbr-actions-version }}
github-token: ${{ github.token }}
json-file: "scripts/tool_version_commands.json"