Skip to content

Commit

Permalink
nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
yylt committed Oct 30, 2024
1 parent bf2ab27 commit d89aefa
Show file tree
Hide file tree
Showing 7 changed files with 1,457 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/actions/ingress/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
steps:
- shell: bash
run: |
set -ex
set -e
ARCH=arm64
if [ $(arch) = "x86_64" ];then
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/wxnotify/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Notify"
description: "通知企业微信"
inputs:
TEXT:
description: '文本信息'
required: true
default: ''
KEY:
description: '企微 bot, 如 aec7e335-af25-47b0-ab01-9019247ccf76'
required: true
default: ''
runs:
using: composite
steps:
- shell: bash
run: |
set -ex
function send()
{
content="$1"
data="{\"msgtype\":\"text\",\"text\":{\"content\":\"$content\"}}"
curl "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${{ inputs.TEXT }}" -H 'Content-Type: application/json' -d "$data"
}
send "${{ inputs.TEXT }}"
94 changes: 0 additions & 94 deletions .github/workflows/ingress-base.yaml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/nginx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: nginx

permissions:
contents: read

on:
push:
branches: [ nginx ]
workflow_dispatch:
env:
PROJECT: ingress-nginx
BRANCH: controller-v1.11.3
REGISTRY_NAME: "docker.io"
REGISTRY_USER: "${{ secrets.DOCKER_HUB_USER }}"
REGISTRY_PASS: "${{ secrets.DOCKER_HUB_PASSWORD }}"

jobs:
build-x86:
name: Build x86
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY_NAME }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASS }}

- uses: actions/checkout@v4
with:
repository: kubernetes/${{ env.PROJECT }}
ref: ${{ env.BRANCH }}
path: ${{ env.PROJECT }}

- shell: bash
run: |
cp -f ingress/Dockerfile-nginx ingress/Dockerfile
cp -a ${{ env.PROJECT }}/rootfs/etc/nginx ${{ env.PROJECT }}/images/nginx/rootfs/
- name: Image Build And Push
uses: ./.github/actions/ingress
with:
REGISTRY_NAME: ${{ env.REGISTRY_NAME }}
PROJECT: ${{ env.PROJECT }}
SCRIPT_VERSION: nginx
NO_GMSSL: y
SKIP_INGRESS: y

build-arm64:
name: Build arm64
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY_NAME }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASS }}

- uses: actions/checkout@v4
with:
repository: kubernetes/${{ env.PROJECT }}
ref: ${{ env.BRANCH }}
path: ${{ env.PROJECT }}

- shell: bash
run: |
cp -f ingress/Dockerfile-nginx ingress/Dockerfile
cp -a ${{ env.PROJECT }}/rootfs/etc/nginx ${{ env.PROJECT }}/images/nginx/rootfs/
- name: Image Build And Push
uses: ./.github/actions/ingress
with:
REGISTRY_NAME: ${{ env.REGISTRY_NAME }}
PROJECT: ${{ env.PROJECT }}
SCRIPT_VERSION: nginx
NO_GMSSL: y
SKIP_INGRESS: y

47 changes: 47 additions & 0 deletions ingress/Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM docker.io/library/debian:12-slim as builder

ARG http_proxy
ARG https_proxy

ENV http_proxy=$http_proxy
ENV https_proxy=$https_proxy

COPY . /
RUN /build.sh

# Use a multi-stage build
FROM docker.io/library/debian:12-slim

ARG http_proxy
ARG https_proxy

ENV http_proxy=$http_proxy
ENV https_proxy=$https_proxy

ENV PATH=$PATH:/usr/local/luajit/bin:/usr/local/nginx/sbin:/usr/local/nginx/bin

ENV LUA_PATH="/usr/local/share/luajit-2.1.0-beta3/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/lib/lua/?.lua;;"
ENV LUA_CPATH="/usr/local/lib/lua/?/?.so;/usr/local/lib/lua/?.so;;"

COPY --from=builder /usr/local /usr/local

RUN apt-get update && \
apt-get install -y --no-install-recommends \
bash \
util-linux \
libpcre3 \
libpcre3-dev \
zlib1g \
zlib1g-dev \
libmaxminddb-dev \
libxslt1-dev \
libssl-dev \
ca-certificates \
libaio-dev \
libxml2 libxml2-dev \
coreutils \
&& rm -rf /var/lib/apt/lists/*

ENV http_proxy=
ENV https_proxy=

Loading

0 comments on commit d89aefa

Please sign in to comment.