add workflows/build-ci-images.yml

This commit is contained in:
Haitao Pan 2024-03-04 20:06:13 +08:00
parent 628582f88b
commit 46f99c88f6
2 changed files with 81 additions and 0 deletions

45
.github/workflows/build-ci-images.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: build & push ci base images
on:
push:
branches:
- dev
- main
paths:
- '.github/workflows/build-ci-images.yml'
pull_request:
branches:
- dev
- main
paths:
- '.github/workflows/build-ci-images.yml'
workflow_dispatch:
branches:
- main
env:
IMAGE_REPO: "artifact.onwalk.net"
IMAGE_PATH: "public/base/code-lint"
IMAGE_TAG: "0.0.1"
jobs:
build-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Artifactory
uses: actions/login-action@v1
with:
registry: ${{ env.IMAGE_REPO }}
username: ${{ secrets.REPO_USER }}
password: ${{ secrets.HELM_REPO_PASSWORD }}
- name: Build & push code-lint images
working-directory: oci/base/debian-code-lint/
run: |
docker build --network host -t "${{ env.IMAGE_REPO }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}" -f Dockerfile .
docker push "${{ env.IMAGE_REPO }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }}"
docker rmi ${{ env.IMAGE_REPO }}/${{ env.IMAGE_PATH }}:${{ env.IMAGE_TAG }} || true

View File

@ -0,0 +1,36 @@
FROM debian:buster
# Install necessary system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
python3 \
python3-pip \
golang-go \
nodejs \
npm \
libyaml-dev \
libffi-dev
# Install pip and Ansible
RUN pip3 install --upgrade pip
RUN pip3 install ansible ansible-lint
# Set up Go, install Go dependencies, and clear Go package cache
RUN go get -u golang.org/x/lint/golint
RUN rm -rf /go/pkg/*
# Install yamllint
RUN pip3 install yamllint
# Set up Node.js and npm, install eslint and React plugin
RUN npm install -g eslint eslint-plugin-react
# Ensure the tools are in the PATH
ENV PATH="/go/bin:${PATH}"
# Set work directory
WORKDIR /src
# Define an entrypoint
ENTRYPOINT ["/bin/bash"]