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