mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-25 07:31:05 -05:00
Merge pull request #342 from github/LocalDev
Build image locally for dev
This commit is contained in:
commit
afd7bb77e1
3 changed files with 36 additions and 76 deletions
53
.github/workflows/cleanup-DEV.yml
vendored
53
.github/workflows/cleanup-DEV.yml
vendored
|
@ -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
|
|
29
.github/workflows/deploy-DEV.yml
vendored
29
.github/workflows/deploy-DEV.yml
vendored
|
@ -20,6 +20,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches-ignore:
|
branches-ignore:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
pull_request: []
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# Set the Job #
|
# Set the Job #
|
||||||
|
@ -40,32 +41,16 @@ jobs:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
#####################
|
###################################
|
||||||
# Run Deploy script #
|
# Build image locally for testing #
|
||||||
#####################
|
###################################
|
||||||
- name: Deploy DEV image to DockerHub
|
- name: Build image
|
||||||
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
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: .automation/upload-docker.sh
|
run: docker build --no-cache -t github/super-linter:${GITHUB_SHA} .
|
||||||
|
|
||||||
#######################
|
|
||||||
# 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 Linter against code base #
|
# Run Linter against code base #
|
||||||
################################
|
################################
|
||||||
- name: Run Test Cases
|
- name: Run Test Cases
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: docker run -e RUN_LOCAL=true -e TEST_CASE_RUN=true -v ${GITHUB_WORKSPACE}:/tmp/lint github/super-linter:${GITHUB_SHA}
|
||||||
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}
|
|
||||||
|
|
30
.github/workflows/versioning.yml
vendored
30
.github/workflows/versioning.yml
vendored
|
@ -1,14 +1,42 @@
|
||||||
name: Keep the versions up-to-date
|
---
|
||||||
|
#########################
|
||||||
|
#########################
|
||||||
|
## Version GitHub Tags ##
|
||||||
|
#########################
|
||||||
|
#########################
|
||||||
|
|
||||||
|
#
|
||||||
|
# Documentation:
|
||||||
|
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
|
||||||
|
#
|
||||||
|
|
||||||
|
##########################
|
||||||
|
# Name of the action job #
|
||||||
|
##########################
|
||||||
|
name: Keep GitHub tag versions up-to-date
|
||||||
|
|
||||||
|
#####################################################
|
||||||
|
# Run the job when a release is published or edited #
|
||||||
|
#####################################################
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published, edited]
|
types: [published, edited]
|
||||||
|
|
||||||
|
#################
|
||||||
|
# Start the job #
|
||||||
|
#################
|
||||||
jobs:
|
jobs:
|
||||||
actions-tagger:
|
actions-tagger:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
|
#############################
|
||||||
|
# Check out the latest code #
|
||||||
|
#############################
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
######################
|
||||||
|
# Run the tag action #
|
||||||
|
######################
|
||||||
- uses: Actions-R-Us/actions-tagger@latest
|
- uses: Actions-R-Us/actions-tagger@latest
|
||||||
with:
|
with:
|
||||||
publish_latest_tag: true
|
publish_latest_tag: true
|
||||||
|
|
Loading…
Reference in a new issue