2019-11-08 09:31:16 -05: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 14:04:41 -05:00
|
|
|
#############################
|
|
|
|
# Start the job on all push #
|
|
|
|
#############################
|
2019-11-08 09:39:18 -05:00
|
|
|
on:
|
|
|
|
push:
|
2020-01-09 14:04:41 -05:00
|
|
|
branches-ignore:
|
2019-11-08 09:39:18 -05:00
|
|
|
- 'master'
|
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: Deploy 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-06-18 13:40:41 -04:00
|
|
|
uses: actions/checkout@v2
|
2019-11-08 09:45:57 -05:00
|
|
|
|
|
|
|
#####################
|
|
|
|
# Run Deploy script #
|
|
|
|
#####################
|
2019-11-08 09:31:16 -05:00
|
|
|
- name: Deploy image to DockerHub
|
2019-11-08 09:42:17 -05:00
|
|
|
env:
|
|
|
|
# Set the Env Vars
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
2020-06-18 14:53:45 -04:00
|
|
|
IMAGE_REPO: github/super-linter
|
2019-11-08 09:42:17 -05:00
|
|
|
DOCKERFILE_PATH: Dockerfile
|
2019-11-08 09:31:16 -05:00
|
|
|
shell: bash
|
|
|
|
run: .automation/upload-docker.sh
|
2020-02-04 12:49:07 -05:00
|
|
|
|
2020-02-04 16:58:06 -05:00
|
|
|
#######################
|
|
|
|
# Get the branch name #
|
|
|
|
#######################
|
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
2020-04-23 12:06:33 -04:00
|
|
|
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^[:alnum:]]//g')"
|
2020-02-04 16:58:06 -05:00
|
|
|
|
2020-02-04 12:49:07 -05:00
|
|
|
################################
|
|
|
|
# Run Linter against code base #
|
|
|
|
################################
|
|
|
|
- name: Run Test Cases
|
2020-02-04 15:52:18 -05:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2020-06-18 14:53:45 -04:00
|
|
|
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}
|