mirror of
https://github.com/minoplhy/deployment.git
synced 2025-04-21 10:46:56 +00:00
enhance code quality
This commit is contained in:
parent
a6f33c0655
commit
8746ad8f9c
46
.github/workflows/forgejo-build.yaml
vendored
Normal file
46
.github/workflows/forgejo-build.yaml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: forgejo Mega Build
|
||||
run-name: forgejo Build
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- forgejo-*
|
||||
jobs:
|
||||
build_forgejo:
|
||||
runs-on: [ubuntu-latest]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up environment variables
|
||||
run: |
|
||||
TAG_NAME=${GITHUB_REF##*/}
|
||||
GITEA_TAG=${TAG_NAME#forgejo-}
|
||||
|
||||
echo "GITEA_TAG=${GITEA_TAG}" >> $GITHUB_ENV
|
||||
echo "GITEA_TAG=${GITEA_TAG}"
|
||||
|
||||
- name: Setup Package Directory
|
||||
run: |
|
||||
sudo mkdir -p /gitea-${GITEA_TAG}
|
||||
|
||||
- name: Run forgejo Build (binary + static)
|
||||
run: |
|
||||
echo "This Task will be run using the following tag: ${GITEA_TAG}"
|
||||
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- --git-tag "${GITEA_TAG}" --static --type=forgejo
|
||||
|
||||
# Copy forgejo to package directory(this is due to a broken mechanism in origin script)
|
||||
sudo cp ~/gitea-binaries/gitea /forgejo-${GITEA_TAG}/gitea
|
||||
sudo cp -r ~/gitea-binaries/gitea-static /forgejo-${GITEA_TAG}/gitea-static
|
||||
|
||||
- name: Zip Package
|
||||
run: |
|
||||
sudo tar czvf forgejo-${GITEA_TAG}.tar.gz /forgejo-${GITEA_TAG}
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
body: |
|
||||
"forgejo Successfully build on -> ${{ env.GITEA_TAG }}"
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
files: forgejo-*.tar.gz
|
56
.github/workflows/freenginx-build.yaml
vendored
56
.github/workflows/freenginx-build.yaml
vendored
@ -18,30 +18,38 @@ jobs:
|
||||
|
||||
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]}
|
||||
|
||||
- name: Run freenginx Build (Vanilla)
|
||||
run: |
|
||||
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} --no-lua --no-modsecurity --type=freenginx
|
||||
tar czvf nginx-${NGINX_TAG}-vanilla.tar.gz ~/nginx_scriptbox/nginx/objs
|
||||
|
||||
- name: Run freenginx Build (All Star)
|
||||
run: |
|
||||
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} --type=freenginx
|
||||
tar czvf nginx-${NGINX_TAG}-allstar.tar.gz ~/nginx_scriptbox/nginx/objs /opt/nginx-lua-module /usr/local/lua /usr/local/modsecurity
|
||||
|
||||
- name: Run freenginx Build (Lua)
|
||||
run: |
|
||||
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} --no-modsecurity --type=freenginx
|
||||
tar czvf nginx-${NGINX_TAG}-lua.tar.gz ~/nginx_scriptbox/nginx/objs /opt/nginx-lua-module /usr/local/lua
|
||||
|
||||
- name: Run freenginx Build (ModSecurity)
|
||||
run: |
|
||||
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} --no-lua --type=freenginx
|
||||
tar czvf nginx-${NGINX_TAG}-modsecurity.tar.gz ~/nginx_scriptbox/nginx/objs /usr/local/modsecurity
|
||||
# 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
|
||||
@ -50,4 +58,4 @@ jobs:
|
||||
body: |
|
||||
"freenginx Successfully build on -> ${{ env.NGINX_TAG }}"
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
files: nginx-*.tar.gz
|
||||
files: freenginx-*.tar.gz
|
||||
|
11
.github/workflows/gitea-build.yaml
vendored
11
.github/workflows/gitea-build.yaml
vendored
@ -23,20 +23,13 @@ jobs:
|
||||
run: |
|
||||
sudo mkdir -p /gitea-${GITEA_TAG}
|
||||
|
||||
- name: Run Gitea Build (binary)
|
||||
- name: Run Gitea Build (binary + static)
|
||||
run: |
|
||||
echo "This Task will be run using the following tag: ${GITEA_TAG}"
|
||||
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- --git-tag "${GITEA_TAG}"
|
||||
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- --git-tag "${GITEA_TAG}" --static --type=gitea
|
||||
|
||||
# Copy gitea to package directory(this is due to a broken mechanism in origin script)
|
||||
sudo cp ~/gitea-binaries/gitea /gitea-${GITEA_TAG}/gitea
|
||||
|
||||
- name: Run Gitea Build (static)
|
||||
run: |
|
||||
echo "This Task will be run using the following tag: ${GITEA_TAG}"
|
||||
curl -L https://github.com/minoplhy/scriptbox/raw/main/build_gitea/Linux/build.sh | bash -s -- --git-tag "${GITEA_TAG}" --static
|
||||
|
||||
# Copy gitea to package directory(this is due to a broken mechanism in origin script)
|
||||
sudo cp -r ~/gitea-binaries/gitea-static /gitea-${GITEA_TAG}/gitea-static
|
||||
|
||||
- name: Zip Package
|
||||
|
60
.github/workflows/nginx-build.yaml
vendored
60
.github/workflows/nginx-build.yaml
vendored
@ -1,5 +1,5 @@
|
||||
name: Nginx Mega Build
|
||||
run-name: Nginx Build
|
||||
name: nginx Mega Build
|
||||
run-name: nginx Build
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
@ -18,36 +18,44 @@ jobs:
|
||||
|
||||
echo "NGINX_TAG=${NGINX_TAG}" >> $GITHUB_ENV
|
||||
echo "NGINX_TAG=${NGINX_TAG}"
|
||||
|
||||
TAGS=("vanilla" "allstar" "lua" "modsecurity")
|
||||
OPTIONS=(
|
||||
"--type=nginx"
|
||||
"--lua --type=nginx"
|
||||
"--lua --type=nginx"
|
||||
"--modsecurity --type=nginx"
|
||||
)
|
||||
|
||||
- name: Run nginx 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]}
|
||||
|
||||
- name: Run Nginx Build (Vanilla)
|
||||
run: |
|
||||
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} --no-lua --no-modsecurity --type=nginx
|
||||
tar czvf nginx-${NGINX_TAG}-vanilla.tar.gz ~/nginx_scriptbox/nginx/objs
|
||||
|
||||
- name: Run Nginx Build (All Star)
|
||||
run: |
|
||||
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} --type=nginx
|
||||
tar czvf nginx-${NGINX_TAG}-allstar.tar.gz ~/nginx_scriptbox/nginx/objs /opt/nginx-lua-module /usr/local/lua /usr/local/modsecurity
|
||||
|
||||
- name: Run Nginx Build (Lua)
|
||||
run: |
|
||||
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} --no-modsecurity --type=nginx
|
||||
tar czvf nginx-${NGINX_TAG}-lua.tar.gz ~/nginx_scriptbox/nginx/objs /opt/nginx-lua-module /usr/local/lua
|
||||
|
||||
- name: Run Nginx Build (ModSecurity)
|
||||
run: |
|
||||
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} --no-lua --type=nginx
|
||||
tar czvf nginx-${NGINX_TAG}-modsecurity.tar.gz ~/nginx_scriptbox/nginx/objs /usr/local/modsecurity
|
||||
# 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 nginx-${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: |
|
||||
"Nginx Successfully build on -> ${{ env.NGINX_TAG }}"
|
||||
"nginx Successfully build on -> ${{ env.NGINX_TAG }}"
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
files: nginx-*.tar.gz
|
||||
|
Loading…
x
Reference in New Issue
Block a user