File tree Expand file tree Collapse file tree 5 files changed +40
-13
lines changed
Expand file tree Collapse file tree 5 files changed +40
-13
lines changed Original file line number Diff line number Diff line change 4141 uses : cssnr/update-version-tags-action@v1
4242 with :
4343 prefix : " "
44+ release : true
4445 # tags: ${{ inputs.tags }}
4546
4647 - name : " Debug Version Tags"
6465 echo "labels: ${{ steps.tags.outputs.labels }}"
6566 echo "annotations: ${{ steps.tags.outputs.annotations }}"
6667
68+ - name : " Parse Nginx Version"
69+ uses : madhead/semver-utils@latest
70+ id : semver
71+ with :
72+ version : ${{ github.ref_name }}
73+
74+ - name : " Debug Nginx Version"
75+ continue-on-error : true
76+ run : |
77+ echo "NGINX_VERSION: ${{ steps.semver.outputs.release }}"
78+
6779 - name : " Build and Push"
6880 uses : docker/build-push-action@v6
6981 with :
7587 annotations : ${{ steps.tags.outputs.annotations }}
7688 build-args : |
7789 VERSION=${{ github.ref_name }}
90+ NGINX_VERSION=${{ steps.semver.outputs.release }}
7891
7992 - name : " Send Failure Notification"
8093 if : ${{ failure() }}
Original file line number Diff line number Diff line change @@ -17,17 +17,18 @@ if [ -f ".env" ];then
1717 set +a
1818fi
1919
20- if [ -z " ${VERSION} " ]; then
21- if [ -n " ${1} " ]; then
22- VERSION=" ${1} "
23- else
24- read -rp " Version (${DEFAULT_VERSION} ): " VERSION
25- fi
26- fi
20+ VERSION=" ${1} "
21+ # if [ -z "${VERSION}" ];then
22+ # if [ -n "${1}" ];then
23+ # VERSION="${1}"
24+ # else
25+ # read -rp "Version (${DEFAULT_VERSION}): " VERSION
26+ # fi
27+ # fi
2728
2829[[ -z " ${VERSION} " ]] && VERSION=" ${DEFAULT_VERSION} "
2930
30- echo " ${REGISTRY_HOST} /${REGISTRY_USER} /${REGISTRY_REPO} :${VERSION} "
31+ echo " ${REGISTRY_HOST} /${REGISTRY_USER} /${REGISTRY_REPO} :latest "
3132
3233
3334# if [ -z "${USERNAME}" ];then
@@ -47,8 +48,9 @@ echo "${REGISTRY_HOST}/${REGISTRY_USER}/${REGISTRY_REPO}:${VERSION}"
4748# --build-arg VERSION="${VERSION}" \
4849# "${BUILD_CONTEXT}"
4950
50- docker build -t " ${REGISTRY_HOST} /${REGISTRY_USER} /${REGISTRY_REPO} :${VERSION} " \
51- --build-arg VERSION=" ${VERSION} " \
51+ docker build -t " ${REGISTRY_HOST} /${REGISTRY_USER} /${REGISTRY_REPO} :latest" \
52+ --build-arg VERSION=" latest" \
53+ --build-arg NGINX_VERSION=" ${VERSION} " \
5254 " ${BUILD_CONTEXT} "
5355
5456# --build-arg VERSION="${VERSION}" \
Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ echo "SERVICE_PORT: ${SERVICE_PORT}"
1313sed " s/SERVICE_PORT/${SERVICE_PORT} /g" -i /etc/nginx/nginx.conf
1414sed " s/SERVICE_NAME/${SERVICE_NAME} /g" -i /etc/nginx/nginx.conf
1515
16+ if [ -n " ${GZIP_TYPES} " ]; then
17+ echo " GZIP_TYPES: ${GZIP_TYPES} "
18+ cat << EOF > /etc/nginx/conf.d/http.gzip.conf
19+ gzip on;
20+ gzip_min_length 1000;
21+ gzip_proxied any;
22+ gzip_types ${GZIP_TYPES} ;
23+ EOF
24+ fi
25+
1626echo " ${0} - Done"
1727
1828nginx -version || :
Original file line number Diff line number Diff line change 1- ARG VERSION =1
2- FROM nginx:${VERSION }-alpine-slim
1+ ARG NGINX_VERSION =1
2+ FROM nginx:${NGINX_VERSION }-alpine-slim
33
44ARG VERSION
55
@@ -10,7 +10,7 @@ LABEL org.opencontainers.image.description="Docker Nginx Proxy"
1010LABEL org.opencontainers.image.authors="smashedr"
1111LABEL org.opencontainers.image.version="${VERSION}"
1212
13- RUN apk add --no-cache curl
13+ RUN apk add --no-cache curl && rm -rf /etc/nginx/conf.d/default.conf
1414
1515COPY --chmod=0755 10-update-config.sh /docker-entrypoint.d
1616
Original file line number Diff line number Diff line change 1919
2020 access_log /dev/stdout main;
2121
22+ include /etc/nginx/conf.d/http .*;
23+
2224 server {
2325 listen 80 ;
2426
You can’t perform that action at this time.
0 commit comments