mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-10 02:53:36 -05:00
37b098dff5
* trying this out
* adding auth
* adding more tags
* check log
* try2
* fix vars
* remove debug
* fix tap
* Revert "fix tap"
This reverts commit 3e1fa4c704
.
* checks
* get sha another way
* fix env vars
* making more env
* checking names
* fix repo name
* fix copypasta
* remove spaces
* fixed container name
* fix var and stop uploading dev
93 lines
3.3 KiB
YAML
93 lines
3.3 KiB
YAML
---
|
|
#########################
|
|
#########################
|
|
## Deploy Docker Image ##
|
|
#########################
|
|
#########################
|
|
|
|
#
|
|
# Documentation:
|
|
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
|
#
|
|
|
|
#######################################
|
|
# Start the job on all push to master #
|
|
#######################################
|
|
#############################
|
|
# Start the job on all push #
|
|
#############################
|
|
on:
|
|
push:
|
|
branches-ignore: [master]
|
|
pull_request:
|
|
branches-ignore: []
|
|
|
|
###############
|
|
# Set the Job #
|
|
###############
|
|
jobs:
|
|
build:
|
|
# Name the Job
|
|
name: Deploy Docker Image - DEV
|
|
# Set the agent to run on
|
|
runs-on: ubuntu-latest
|
|
# 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
|
|
##################
|
|
# Load all steps #
|
|
##################
|
|
steps:
|
|
##########################
|
|
# Checkout the code base #
|
|
##########################
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2.3.4
|
|
|
|
########################
|
|
# Get the current date #
|
|
########################
|
|
- name: Get current date
|
|
run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV}
|
|
|
|
###################################
|
|
# 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
|
|
|
|
########################################
|
|
# Validates the metadata docker labels #
|
|
########################################
|
|
- name: Run Docker label test cases
|
|
shell: bash
|
|
run: .automation/validate-docker-labels.sh
|
|
|
|
#####################################
|
|
# Run Linter against Test code base #
|
|
#####################################
|
|
- name: Run Test Cases
|
|
shell: bash
|
|
run: docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -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}
|
|
|
|
#########################################
|
|
# Clean code base to run against it all #
|
|
#########################################
|
|
- 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}
|