diff --git a/.github/workflows/cleanup-DEV.yml b/.github/workflows/cleanup-DEV.yml deleted file mode 100644 index 53ef1f6a..00000000 --- a/.github/workflows/cleanup-DEV.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -########################## -########################## -## Cleanup Docker Image ## -########################## -########################## - -# -# Documentation: -# https://help.github.com/en/articles/workflow-syntax-for-github-actions -# - -######################################## -# Run job when PR is merged and closed # -######################################## - -on: - pull_request: - types: [closed] - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Cleanup Docker Image - DEV - # Set the agent to run on - runs-on: ubuntu-latest - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - - ###################### - # Run Removal script # - ###################### - - name: Remove old image from DockerHub - env: - # Set the Env Vars - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - IMAGE_REPO: github/super-linter - IMAGE_VERSION: ${{ github.event.pull_request.head.ref }} - shell: bash - run: .automation/cleanup-docker.sh diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index d9af1b44..0f55b010 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -20,6 +20,7 @@ on: push: branches-ignore: - 'master' + pull_request: [] ############### # Set the Job # @@ -40,32 +41,16 @@ jobs: - name: Checkout Code uses: actions/checkout@v2 - ##################### - # Run Deploy script # - ##################### - - name: Deploy DEV image to DockerHub - env: - # Set the Env Vars - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - IMAGE_REPO: github/super-linter - DOCKERFILE_PATH: Dockerfile - REGISTRY: Docker + ################################### + # Build image locally for testing # + ################################### + - name: Build image shell: bash - run: .automation/upload-docker.sh - - ####################### - # Get the branch name # - ####################### - - name: Extract branch name - shell: bash - run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^[:alnum:]]//g')" + run: docker build --no-cache -t github/super-linter:${GITHUB_SHA} . ################################ # Run Linter against code base # ################################ - name: Run Test Cases shell: bash - run: | - docker pull github/super-linter:${BRANCH_NAME} - docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${BRANCH_NAME} + run: docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${GITHUB_SHA}