lint/.github/workflows/deploy-DEV.yml

94 lines
3.4 KiB
YAML
Raw Normal View History

2019-11-08 08:31:16 -06:00
---
#########################
#########################
## Deploy Docker Image ##
#########################
#########################
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#
#######################################
# Start the job on all push to master #
#######################################
2020-01-09 13:04:41 -06:00
#############################
# Start the job on all push #
#############################
2019-11-08 08:39:18 -06:00
on:
push:
2020-07-21 12:08:50 -05:00
branches-ignore: [master]
pull_request:
branches-ignore: []
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: Deploy Docker Image - DEV
2019-11-08 08:31:16 -06:00
# Set the agent to run on
runs-on: ubuntu-latest
2020-07-01 08:35:15 -05:00
# Prevent duplicate run from happening when a forked push is committed
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
2019-11-08 08:31:16 -06:00
##################
# Load all steps #
##################
steps:
2019-11-08 08:45:57 -06:00
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2.3.4
2019-11-08 08:45:57 -06:00
########################
# Get the current date #
########################
- name: Get current date
2020-11-16 10:25:04 -06:00
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV}
2020-06-25 09:26:59 -05:00
###################################
# Build image locally for testing #
###################################
- name: Build image
uses: whoan/docker-build-with-cache-action@v5
with:
username: ${{ secrets.GCR_USERNAME }}
password: ${{ secrets.GCR_TOKEN }}
registry: ghcr.io
image_name: github/super-linter
image_tag: ${{ github.sha }}
dockerfile: Dockerfile
build_extra_args: "--build-arg=BUILD_DATE=${{ env.BUILD_DATE }} --build-arg=BUILD_REVISION=${{ github.sha }} --build-arg=BUILD_VERSION=${{ github.sha }}"
push_image_and_stages: false
2020-02-04 15:58:06 -06:00
2020-09-04 09:52:04 -05:00
########################################
# Validates the metadata docker labels #
########################################
- name: Run Docker label test cases
shell: bash
run: .automation/validate-docker-labels.sh
2020-08-06 13:16:23 -05:00
#####################################
# Run Linter against Test code base #
#####################################
2020-02-04 11:49:07 -06:00
- name: Run Test Cases
2020-02-04 14:52:18 -06:00
shell: bash
run: docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -e ANSIBLE_DIRECTORY=.automation/test/ansible -e OUTPUT_FORMAT=tap -e OUTPUT_FOLDER=${GITHUB_SHA} -e OUTPUT_DETAILS=detailed -e ACTIONS_RUNNER_DEBUG=true -e ERROR_ON_MISSING_EXEC_BIT=true -v ${GITHUB_WORKSPACE}:/tmp/lint ghcr.io/github/super-linter:${GITHUB_SHA}
2020-08-06 13:16:23 -05:00
#########################################
2020-09-22 00:53:30 +02:00
# Clean code base to run against it all #
2020-08-06 13:16:23 -05:00
#########################################
- name: Clean Test code base for additional testing
shell: bash
run: .automation/clean-code-base-for-tests.sh
############################################
# Run Linter against ALL cleaned code base #
############################################
- name: Run against all code base
shell: bash
run: docker run -e RUN_LOCAL=true -e OUTPUT_DETAILS=detailed -e ACTIONS_RUNNER_DEBUG=true -e ERROR_ON_MISSING_EXEC_BIT=true -v ${GITHUB_WORKSPACE}:/tmp/lint ghcr.io/github/super-linter:${GITHUB_SHA}