1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-09-11 19:32:24 +02:00

Merge pull request #342 from GilbN/develop

added TP_SCHEME env, build on master
This commit is contained in:
GilbN 2022-03-23 21:27:15 +01:00 committed by GitHub
commit 5bcf8e8653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 18 deletions

View File

@ -3,9 +3,20 @@ on:
release:
types:
- released
workflow_dispatch:
inputs:
branch:
description: 'Select branch'
required: true
type: choice
options:
- master
- develop
push:
branches:
- develop
paths-ignore:
- '.github/**'
jobs:
push_to_ghcr_io:
runs-on: ubuntu-latest
@ -27,12 +38,12 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: build&push master
if: ${{ github.event.release.target_commitish == 'live' }}
if: ${{ github.event.release.target_commitish == 'master' || github.event.inputs.branch == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
docker push --all-tags ghcr.io/gilbn/theme.park
- name: build&push develop
if: ${{ github.ref == 'refs/heads/develop' }}
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park:develop .
docker push --all-tags ghcr.io/gilbn/theme.park
@ -55,12 +66,12 @@ jobs:
username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build&push dh master
if: ${{ github.event.release.target_commitish == 'live' }}
if: ${{ github.event.release.target_commitish == 'master' || github.event.inputs.branch == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
docker push --all-tags gilbn/theme.park
- name: build&push dh develop
if: ${{ github.ref == 'refs/heads/develop' }}
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park:develop .
docker push --all-tags gilbn/theme.park

View File

@ -9,8 +9,10 @@ server {
location / {
sub_filter_types *;
sub_filter 'https://theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'https://develop.theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'https://theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'http://theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'https://develop.theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'http://develop.theme-park.dev' $scheme://TP_DOMAIN;
sub_filter_once off;
try_files $uri $uri/ /index.html;
}

View File

@ -9,6 +9,7 @@ echo -e "Variables set:\\n\
PUID=${PUID}\\n\
PGID=${PGID}\\n\
TZ=${TZ}\\n\
TP_SCHEME=${TP_SCHEME}\\n\
TP_DOMAIN=${TP_DOMAIN}\\n"
if [[ -z ${TP_DOMAIN} ]]; then
@ -16,11 +17,8 @@ if [[ -z ${TP_DOMAIN} ]]; then
TP_DOMAIN='$http_host'
fi
DEFAULT='/config/nginx/site-confs/default'
if ! grep -q "sub_filter 'https://theme-park.dev' \$scheme://${TP_DOMAIN};" ${DEFAULT}; then
sed -i "s/sub_filter 'https:\/\/theme-park.dev' \$scheme:\/\/TP_DOMAIN;/sub_filter 'https:\/\/theme-park.dev' \$scheme:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
sed -i "s/sub_filter 'https:\/\/develop.theme-park.dev' \$scheme:\/\/TP_DOMAIN;/sub_filter 'https:\/\/develop.theme-park.dev' \$scheme:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
fi
sed -i "s/TP_DOMAIN;/${TP_DOMAIN}; /g" /defaults/default
cp /defaults/default /config/nginx/site-confs
# make our folders and links
mkdir -p \

View File

@ -38,12 +38,12 @@ def create_addons_json():
f"{addon_root}/{app}/{addon}") if isfile(join(f"{addon_root}/{app}/{addon}", file))]
if len([f for f in files if f.endswith('.css')]) > 1:
ADDONS["addons"][app][addon].update({
"css": [f"https://{DOMAIN}/css/addons/{app}/{addon}/{file}?sha={SHAS.get(file)}" for file in files if file.split(".")[1] == "css"]
"css": [f"{scheme}://{DOMAIN}/css/addons/{app}/{addon}/{file}?sha={SHAS.get(file)}" for file in files if file.split(".")[1] == "css"]
}
)
else:
ADDONS["addons"][app].update({
addon: f"https://{DOMAIN}/css/addons/{app}/{addon}/{file}?sha={SHAS.get(file)}" for file in files if file.split(".")[1] == "css"
addon: f"{scheme}://{DOMAIN}/css/addons/{app}/{addon}/{file}?sha={SHAS.get(file)}" for file in files if file.split(".")[1] == "css"
}
)
extra_dirs = [dir for dir in listdir(
@ -54,7 +54,7 @@ def create_addons_json():
f"{addon_root}/{app}/{addon}/{dir}") if isfile(join(f"{addon_root}/{app}/{addon}/{dir}", file))]
ADDONS["addons"][app][addon].update({
dir: {
"css": [f"https://{DOMAIN}/css/addons/{app}/{addon}/{dir}/{extra_file}?sha={SHAS.get(extra_file)}" for extra_file in extra_dir_files if extra_file.split(".")[1] == "css"]
"css": [f"{scheme}://{DOMAIN}/css/addons/{app}/{addon}/{dir}/{extra_file}?sha={SHAS.get(extra_file)}" for extra_file in extra_dir_files if extra_file.split(".")[1] == "css"]
}
}
)
@ -70,12 +70,12 @@ def create_json(app_folders: list = None, themes: list = None, community_themes:
COMMUNITY_THEME_SHAS = get_shas(community_theme_shas)
THEMES = {
theme.split(".")[0].capitalize(): {
"url": f"https://{DOMAIN}/css/theme-options/{theme}?sha={THEME_SHAS.get(theme)}"
"url": f"{scheme}://{DOMAIN}/css/theme-options/{theme}?sha={THEME_SHAS.get(theme)}"
}for theme in themes
}
COMMUNITY_THEMES = {
theme.split(".")[0].capitalize(): {
"url": f"https://{DOMAIN}/css/community-theme-options/{theme}?sha={COMMUNITY_THEME_SHAS.get(theme)}"
"url": f"{scheme}://{DOMAIN}/css/community-theme-options/{theme}?sha={COMMUNITY_THEME_SHAS.get(theme)}"
}for theme in community_themes
}
THEMES_DICT.update(dict(sorted({
@ -98,7 +98,7 @@ def create_json(app_folders: list = None, themes: list = None, community_themes:
APPS.update(dict(sorted({
"applications": {
app: {
"base_css": f"https://{DOMAIN}/css/base/{app}/{app}-base.css?sha={SHAS.get(f'{app}-base.css')}",
"base_css": f"{scheme}://{DOMAIN}/css/base/{app}/{app}-base.css?sha={SHAS.get(f'{app}-base.css')}",
"addons": ADDONS["addons"][app] if app in ADDONS["addons"] else {}
} for app in app_folders if not isfile(f'./css/base/{app}/.deprecated')
}
@ -106,7 +106,7 @@ def create_json(app_folders: list = None, themes: list = None, community_themes:
APPS.update(dict(sorted({
"deprecated": {
app: {
"base_css": f"https://{DOMAIN}/css/base/{app}/{app}-base.css?sha={SHAS.get(f'{app}-base.css')}",
"base_css": f"{scheme}://{DOMAIN}/css/base/{app}/{app}-base.css?sha={SHAS.get(f'{app}-base.css')}",
"addons": ADDONS["addons"][app] if app in ADDONS["addons"] else {}
} for app in app_folders if isfile(f'./css/base/{app}/.deprecated')
}
@ -132,6 +132,7 @@ def create_theme_options():
create_css(folder)
env_domain = env.get('TP_DOMAIN')
scheme = env.get('TP_SCHEME','https')
if __name__ == "__main__":
app_folders = [name for name in listdir('./css/base') if isdir(join('./css/base', name))]