1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-11-20 01:52:32 +01:00
theme.park/.github/workflows/auto-build.yml

140 lines
5.0 KiB
YAML
Raw Normal View History

2021-09-12 15:36:09 +02:00
name: autobuildallthemods
on:
push:
branches:
- master
paths:
- 'docker-mods/**'
2022-05-15 16:58:50 +02:00
workflow_dispatch:
inputs:
app:
description: 'Select an app'
required: true
type: choice
options:
- radarr
- sonarr
- readarr
- lidarr
- bazarr
- whisparr
- prowlarr
- plex
- jellyfin
- emby
- sabnzbd
- synclounge
- transmission
- calibre-web
- lazylibrarian
- mylar3
- duplicati
- tautulli
- vuetorrent
- deluge
- jackett
- librespeed
- nzbget
- qbittorrent
- rutorrent
- swag
- thelounge
2022-09-03 19:36:04 +02:00
- build-all-the-mods
2022-09-03 17:48:32 +02:00
append-tag:
required: false
description: 'Append a the tag with "-custom" e.g :radarr-testing'
2021-09-12 15:36:09 +02:00
jobs:
push_to_ghcr_io:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.1.0
2021-09-12 15:36:09 +02:00
with:
fetch-depth: 0
- name: get changed files
id: getfile
run: |
echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV
2021-09-12 15:36:09 +02:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
2021-09-12 15:36:09 +02:00
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: find correct directory then build&push
2022-05-15 16:58:50 +02:00
if: ${{ github.event_name == 'push' }}
2021-09-12 15:36:09 +02:00
run: |
for i in ${{ env.files }}
2021-09-12 15:36:09 +02:00
do
directory="$( echo $i | cut -d'/' -f2 -s )"
if [ -z "$directory" ]; then
continue # Skip root dir
elif [ "$i" == *.md ]; then
continue # Skip markdown files
elif [ "$i" == *.yml ]; then
continue # Skip YAML files
fi
docker build docker-mods/$directory --tag ghcr.io/gilbn/theme.park:$directory
docker push ghcr.io/gilbn/theme.park:$directory
done
2022-05-15 16:58:50 +02:00
- name: manually build
2022-09-04 11:31:30 +02:00
if: ${{ github.event.inputs.app && github.event.inputs.app != 'build-all-the-mods' }}
2022-05-15 16:58:50 +02:00
run: |
2022-09-03 17:48:32 +02:00
docker build docker-mods/${{ github.event.inputs.app }} --tag ghcr.io/gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }}
docker push ghcr.io/gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }}
2022-09-03 19:36:04 +02:00
- name: manually build all mods
if: ${{ github.event.inputs.app == 'build-all-the-mods' }}
run: |
for dir in docker-mods/*;
do
app="$( echo "$dir" | cut -d'/' -f2 -s )"
docker build docker-mods/$app --tag ghcr.io/gilbn/theme.park:$app${{ github.event.inputs.append-tag }}
docker push ghcr.io/gilbn/theme.park:$app${{ github.event.inputs.append-tag }}
done
2021-09-12 15:36:09 +02:00
push_to_dockerhub:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.1.0
2021-09-12 15:36:09 +02:00
with:
fetch-depth: 0
- name: get changed files
id: getfile
run: |
echo "files=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)" >> $GITHUB_ENV
2021-09-12 15:36:09 +02:00
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
2021-09-12 15:36:09 +02:00
with:
username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: find correct directory then build&push
2022-05-15 16:58:50 +02:00
if: ${{ github.event_name == 'push' }}
2021-09-12 15:36:09 +02:00
run: |
for i in ${{ env.files }}
2021-09-12 15:36:09 +02:00
do
directory="$( echo $i | cut -d'/' -f2 -s )"
if [ -z "$directory" ]; then
continue # Skip root dir
elif [ "$i" == *.md ]; then
continue # Skip markdown files
elif [ "$i" == *.yml ]; then
continue # Skip YAML files
fi
docker build docker-mods/$directory --tag gilbn/theme.park:$directory
docker push gilbn/theme.park:$directory
2022-05-15 16:58:50 +02:00
done
- name: manually build
2022-09-04 11:31:30 +02:00
if: ${{ github.event.inputs.app && github.event.inputs.app != 'build-all-the-mods' }}
2022-05-15 16:58:50 +02:00
run: |
2022-09-03 17:48:32 +02:00
docker build docker-mods/${{ github.event.inputs.app }} --tag gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }}
2022-09-03 19:36:04 +02:00
docker push gilbn/theme.park:${{ github.event.inputs.app }}${{ github.event.inputs.append-tag }}
- name: manually build all mods
if: ${{ github.event.inputs.app == 'build-all-the-mods' }}
run: |
for dir in docker-mods/*;
do
app="$( echo "$dir" | cut -d'/' -f2 -s )"
docker build docker-mods/$app --tag gilbn/theme.park:$app${{ github.event.inputs.append-tag }}
docker push gilbn/theme.park:$app${{ github.event.inputs.append-tag }}
done