-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of manual delete docker #TASK-7417
- Loading branch information
1 parent
f28577c
commit ad2b9d4
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Manual Delete Docker Image | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
call-delete-docker: | ||
name: Call Reusable Delete Docker Workflow | ||
uses: opencb/cellbase/.github/workflows/reusable-delete-docker.yml@develop | ||
with: | ||
task: ${{ inputs.task }} | ||
secrets: inherit |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Reusable delete docker workflow from DockerHub | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
task: | ||
type: string | ||
required: true | ||
secrets: | ||
DOCKER_HUB_USER: | ||
required: true | ||
DOCKER_HUB_PASSWORD: | ||
required: true | ||
|
||
jobs: | ||
delete-docker: | ||
name: Execute delete docker image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '10' | ||
- name: Validate task name | ||
if: ${{ !startsWith(inputs.task, 'TASK') }} | ||
run: | | ||
echo "Error: Can't delete ${{ inputs.task }}. Only Docker images related to TASK branches can be deleted" | ||
exit 1 | ||
- name: Delete in Docker Hub | ||
if: ${{ startsWith(inputs.task, 'TASK') }} | ||
run: | | ||
echo "Deleting docker image ${{ inputs.task }}" | ||
python3 ./cellbase-app/app/cloud/docker/docker-build.py delete --images base --tag ${{ inputs.task }} --username ${{ secrets.DOCKER_HUB_USER }} --password ${{ secrets.DOCKER_HUB_PASSWORD }} |