add workflows/build-ci-images.yml
This commit is contained in:
parent
628582f88b
commit
46f99c88f6
45
.github/workflows/build-ci-images.yml
vendored
Normal file
45
.github/workflows/build-ci-images.yml
vendored
Normal 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
|
||||
36
oci/base/debian-code-lint/Dockerfile
Normal file
36
oci/base/debian-code-lint/Dockerfile
Normal 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"]
|
||||
Loading…
Reference in New Issue
Block a user