1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-10-02 21:47:12 +02:00
This commit is contained in:
GilbN 2022-10-23 14:36:47 +00:00
parent 17afdb28b2
commit 29b208992a
5 changed files with 58 additions and 62 deletions

View File

@ -48,15 +48,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: get changed files
id: getfile
run: |
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)"
echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -64,7 +64,7 @@ jobs:
- name: find correct directory then build&push
if: ${{ github.event_name == 'push' }}
run: |
for i in ${{ steps.getfile.outputs.files }}
for i in ${{ env.files }}
do
directory="$( echo $i | cut -d'/' -f2 -s )"
if [ -z "$directory" ]; then
@ -95,22 +95,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: get changed files
id: getfile
run: |
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)"
echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: find correct directory then build&push
if: ${{ github.event_name == 'push' }}
run: |
for i in ${{ steps.getfile.outputs.files }}
for i in ${{ env.files }}
do
directory="$( echo $i | cut -d'/' -f2 -s )"
if [ -z "$directory" ]; then

View File

@ -14,7 +14,7 @@ on:
- develop
- testing
tag:
description: 'Add a tag'
description: 'Append a the tag with "-custom" e.g :develop-custom'
push:
branches:
- develop
@ -29,68 +29,68 @@ jobs:
architecture: [linux-arm-v7,linux-arm64,linux-amd64]
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Prepare
id: prep
run: |
ARCHITECTURE=${{ matrix.architecture }}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=title::${GITHUB_REPOSITORY,,}:${{ github.ref_name }}
echo ::set-output name=revision::${GITHUB_SHA}
echo ::set-output name=source::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY,,}/tree/${{ github.ref_name }}
echo ::set-output name=vendor::${{ github.repository_owner }}
echo ::set-output name=url::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY,,}/blob/master/README.md
echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
echo ::set-output name=platform::${ARCHITECTURE//-/\/}
echo ::set-output name=cache::${GITHUB_REPOSITORY,,}:${{ github.ref_name }}-cache-${{ matrix.architecture }}
echo ::set-output name=tag::${GITHUB_REPOSITORY,,}:${{ github.ref_name }}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}-${{ matrix.architecture }}
echo ::set-output name=release::${{ github.event.release.target_commitish }}
echo "ARCHITECTURE=${{ matrix.architecture }}" >> $GITHUB_ENV
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
echo "title=${GITHUB_REPOSITORY,,}:${{ github.ref_name }}" >> $GITHUB_ENV
echo "revision=${GITHUB_SHA}" >> $GITHUB_ENV
echo "source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY,,}/tree/${{ github.ref_name }}" >> $GITHUB_ENV
echo "vendor=${{ github.repository_owner }}" >> $GITHUB_ENV
echo "url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY,,}/blob/master/README.md" >> $GITHUB_ENV
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "platform=${ARCHITECTURE//-/\/}" >> $GITHUB_ENV
echo "cache=${GITHUB_REPOSITORY,,}:${{ github.ref_name }}-cache-${{ matrix.architecture }}${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "tag=${GITHUB_REPOSITORY,,}:${{ github.ref_name }}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}-${{ matrix.architecture }}${{ github.event.inputs.tag }}" >> $GITHUB_ENV
echo "release=${{ github.event.release.target_commitish }}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2.1.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2.2.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build&push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3.2.0
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: ${{ steps.prep.outputs.platform }}
platforms: ${{ env.platform }}
file: ./${{ matrix.architecture }}.Dockerfile
cache-from: docker.io/${{ steps.prep.outputs.cache }}
cache-to: docker.io/${{ steps.prep.outputs.cache }}
cache-from: docker.io/${{ env.cache }}
cache-to: docker.io/${{ env.cache }}
tags: |
docker.io/${{ steps.prep.outputs.tag }}
ghcr.io/${{ steps.prep.outputs.tag }}
docker.io/${{ env.tag }}
ghcr.io/${{ env.tag }}
labels: |
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.title=${{ steps.prep.outputs.title }}
org.opencontainers.image.revision=${{ steps.prep.outputs.revision }}
org.opencontainers.image.source=${{ steps.prep.outputs.source }}
org.opencontainers.image.vendor=${{ steps.prep.outputs.vendor }}
org.opencontainers.image.url=${{ steps.prep.outputs.url }}
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
org.opencontainers.image.created=${{ env.created }}
org.opencontainers.image.title=${{ env.title }}
org.opencontainers.image.revision=${{ env.revision }}
org.opencontainers.image.source=${{ env.source }}
org.opencontainers.image.vendor=${{ env.vendor }}
org.opencontainers.image.url=${{ env.url }}
org.opencontainers.image.version=${{ env.VERSION }}
build-args: |
TP_RELEASE=${{ steps.prep.outputs.VERSION }}
BUILD_DATE=${{ steps.date_time.outputs.created }}
BUILD_ARCHITECTURE=${{ matrix.architecture }}
TP_RELEASE=${{ env.VERSION }}
BUILD_DATE=${{ env.created }}
BUILD_ARCHITECTURE=${{ env.ARCHITECTURE }}
publish:
runs-on: ubuntu-latest
@ -100,11 +100,11 @@ jobs:
needs: [build-and-push-it-to-the-limit]
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3.1.0
- name: Login to DockerHub
if: matrix.registry == 'docker.io'
uses: docker/login-action@v1
uses: docker/login-action@v2.1.0
with:
registry: docker.io
username: ${{ secrets.DH_USER }}
@ -112,7 +112,7 @@ jobs:
- name: Login to GitHub Container Registry
if: matrix.registry == 'ghcr.io'
uses: docker/login-action@v1
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -123,16 +123,16 @@ jobs:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
IMAGE=${{ matrix.registry }}/${GITHUB_REPOSITORY,,}
TAG=${{ github.ref_name }}
SOURCE=${IMAGE}:${TAG}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}
VERSION=${{ steps.prep.outputs.VERSION }}
[[ -f linux-amd64.Dockerfile ]] && AMD64=${SOURCE}-linux-amd64
[[ -f linux-arm64.Dockerfile ]] && ARM64=${SOURCE}-linux-arm64
[[ -f linux-arm-v7.Dockerfile ]] && ARMV7=${SOURCE}-linux-arm-v7
TAG=${{ github.ref_name }}-${GITHUB_SHA:0:7}-${GITHUB_RUN_NUMBER}
SOURCE=${IMAGE}:${TAG}
[[ -f linux-amd64.Dockerfile ]] && AMD64=${SOURCE}-linux-amd64${{ github.event.inputs.tag }}
[[ -f linux-arm64.Dockerfile ]] && ARM64=${SOURCE}-linux-arm64${{ github.event.inputs.tag }}
[[ -f linux-arm-v7.Dockerfile ]] && ARMV7=${SOURCE}-linux-arm-v7${{ github.event.inputs.tag }}
docker manifest create ${IMAGE}:${TAG}${{ github.event.inputs.tag }} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}${{ github.event.inputs.tag }}
TAG=${{ github.ref_name }}${{ github.event.inputs.tag }}
docker manifest create ${IMAGE}:${TAG} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}
docker manifest create ${IMAGE}:${TAG}-${GITHUB_SHA:0:7} ${AMD64} ${ARM64} ${ARMV7}
docker manifest push ${IMAGE}:${TAG}-${GITHUB_SHA:0:7}
- name: Latest manifest
if: ${{ github.event.release.target_commitish == 'master' }}
env:

View File

@ -23,7 +23,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Wrong domain check
@ -34,7 +34,7 @@ jobs:
exit 1
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4.3.0
- name: Run themes.py
run: |
python themes.py
@ -63,7 +63,7 @@ jobs:
fi
done
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v3.8.0
if: ${{ github.ref == 'refs/heads/master' || github.event.inputs.branch == 'master' }}
with:
publish_dir: ./
@ -71,7 +71,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
exclude_assets: ''
- name: Deploy Develop
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v3.8.0
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
with:
publish_dir: ./
@ -79,7 +79,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
exclude_assets: ''
- name: Deploy Testing
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v3.8.0
if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }}
with:
publish_dir: ./

View File

@ -92,8 +92,6 @@ fi
sed_file(){
sed -i "s/<\/body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/qbittorrent\/qbittorrent-base.css'><\/body> /g" $1
sed -i "s/<\/body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/body> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/qbittorrent\/qbittorrent-base.css'><\/head> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/head> /g" $1
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
}

View File

@ -79,8 +79,6 @@ fi
sed_file(){
sed -i "s/<\/body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/qbittorrent\/qbittorrent-base.css'><\/body> /g" $1
sed -i "s/<\/body>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/body> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/base\/qbittorrent\/qbittorrent-base.css'><\/head> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='${TP_SCHEME}:\/\/${TP_DOMAIN}\/css\/${THEME_TYPE}\/${TP_THEME}.css'><\/head> /g" $1
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
}