2019-11-08 08:31:16 -06:00
|
|
|
---
|
2020-01-09 13:04:41 -06:00
|
|
|
##########################
|
|
|
|
##########################
|
|
|
|
## Cleanup Docker Image ##
|
|
|
|
##########################
|
|
|
|
##########################
|
2019-11-08 08:31:16 -06:00
|
|
|
|
|
|
|
#
|
|
|
|
# Documentation:
|
|
|
|
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
|
|
|
#
|
|
|
|
|
2020-01-09 13:04:41 -06:00
|
|
|
########################################
|
|
|
|
# Run job when PR is merged and closed #
|
|
|
|
########################################
|
|
|
|
|
2019-11-08 08:39:18 -06:00
|
|
|
on:
|
2020-01-09 13:04:41 -06:00
|
|
|
pull_request:
|
2020-01-09 13:12:36 -06:00
|
|
|
types: [closed]
|
2019-11-08 08:31:16 -06:00
|
|
|
|
|
|
|
###############
|
|
|
|
# Set the Job #
|
|
|
|
###############
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
# Name the Job
|
2020-01-09 13:04:41 -06:00
|
|
|
name: Cleanup Docker Image - DEV
|
2019-11-08 08:31:16 -06:00
|
|
|
# Set the agent to run on
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
##################
|
|
|
|
# Load all steps #
|
|
|
|
##################
|
|
|
|
steps:
|
2019-11-08 08:45:57 -06:00
|
|
|
##########################
|
|
|
|
# Checkout the code base #
|
|
|
|
##########################
|
|
|
|
- name: Checkout Code
|
2020-01-09 13:50:54 -06:00
|
|
|
uses: actions/checkout@v2
|
2020-01-09 14:07:47 -06:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2019-11-08 08:45:57 -06:00
|
|
|
|
2020-01-09 13:04:41 -06:00
|
|
|
######################
|
|
|
|
# Run Removal script #
|
|
|
|
######################
|
|
|
|
- name: Remove old image from DockerHub
|
2019-11-08 08:42:17 -06:00
|
|
|
env:
|
|
|
|
# Set the Env Vars
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
IMAGE_REPO: admiralawkbar/super-linter
|
2020-01-09 14:06:13 -06:00
|
|
|
IMAGE_VERSION: ${{ github.event.pull_request.head.ref }}
|
2019-11-08 08:31:16 -06:00
|
|
|
shell: bash
|
2020-01-09 13:04:41 -06:00
|
|
|
run: .automation/cleanup-docker.sh
|