add build-ci-image-golint.yml

This commit is contained in:
Haitao Pan 2024-04-27 19:52:18 +08:00
parent 4143ff096b
commit b3479d2211
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,28 @@
name: build images golint
on:
pull_request:
branches:
- main
paths:
- 'oci/base/alpine-golint/Dockerfile'
- 'build-ci-image-eslint.yml/build-ci-image-golint.yml'
workflow_dispatch:
branches:
- main
env:
IMAGE_REPO: "artifact.onwalk.net"
jobs:
eslint:
name: Build ESlint image
uses: svc-design/actions/.github/workflows/build-images.yaml@main
with:
method: 'docker/node'
registry_addr: "harbor.onwalk.net"
dockerfile_path: 'oci/base/alpine-golint'
image_name: 'public/base/alpine-golint'
image_tag: 'latest'
secrets:
artifactory_sa: ${{ secrets.REPO_USER }}
artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

View File

@ -0,0 +1,20 @@
# Use the official Alpine-based Go image
FROM golang:1.18-alpine
# Set the working directory
WORKDIR /src
# Install Git and other dependencies necessary for your environment
RUN apk update && apk add --no-cache git bash wget
# Install gitleaks using binary installation
RUN wget https://mirrors.onwalk.net/tools/gitleaks_8.2.4_linux_x64.tar.gz \
&& tar -xf gitleaks_8.2.4_linux_x64.tar.gz \
&& mv gitleaks /usr/bin/ \
&& rm gitleaks_8.2.4_linux_x64.tar.gz
# Install Go lint tools
RUN go install golang.org/x/lint/golint@latest
# Set the entry point to bash
ENTRYPOINT ["/bin/bash"]