mirror of
https://github.com/minoplhy/deployment.git
synced 2025-04-21 18:46:57 +00:00
62 lines
2.0 KiB
YAML
62 lines
2.0 KiB
YAML
name: freenginx Mega Build
|
|
run-name: freenginx Build
|
|
on:
|
|
push:
|
|
tags:
|
|
- freenginx-*
|
|
jobs:
|
|
build_nginx:
|
|
runs-on: [ubuntu-latest]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up environment variables
|
|
run: |
|
|
TAG_NAME=${GITHUB_REF##*/}
|
|
NGINX_TAG=${TAG_NAME#freenginx-}
|
|
|
|
echo "NGINX_TAG=${NGINX_TAG}" >> $GITHUB_ENV
|
|
echo "NGINX_TAG=${NGINX_TAG}"
|
|
|
|
TAGS=("vanilla" "allstar" "lua" "modsecurity")
|
|
OPTIONS=(
|
|
"--type=freenginx"
|
|
"--lua --type=freenginx"
|
|
"--lua --type=freenginx"
|
|
"--modsecurity --type=freenginx"
|
|
)
|
|
|
|
- name: Run freenginx Builds
|
|
run: |
|
|
for i in ${!TAGS[@]}; do
|
|
echo "This Task will be run using the following tag: ${NGINX_TAG}"
|
|
curl https://raw.githubusercontent.com/minoplhy/scriptbox/main/nginx_build_script/build.sh | bash -s -- --nginx-tag=${NGINX_TAG} ${OPTIONS[$i]}
|
|
|
|
# Prepare tar file paths
|
|
TAR_PATH="~/nginx_scriptbox/nginx/objs" # Base Path
|
|
case "${TAGS[$i]}" in
|
|
"allstar")
|
|
TAR_PATH="$TAR_PATH /opt/nginx-lua-module /usr/local/lua /usr/local/modsecurity"
|
|
;;
|
|
"lua")
|
|
TAR_PATH="$TAR_PATH /opt/nginx-lua-module /usr/local/lua"
|
|
;;
|
|
"modsecurity")
|
|
TAR_PATH="$TAR_PATH /usr/local/modsecurity"
|
|
;;
|
|
esac
|
|
|
|
# Create the tarball
|
|
tar czvf freenginx-${NGINX_TAG}-${TAGS[$i]}.tar.gz $TAR_PATH
|
|
done
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
body: |
|
|
"freenginx Successfully build on -> ${{ env.NGINX_TAG }}"
|
|
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
|
files: freenginx-*.tar.gz
|