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

71 lines
2.5 KiB
YAML
Raw Normal View History

2021-09-12 15:36:09 +02:00
name: autobuildallthemods
on:
push:
branches:
- master
paths:
- 'docker-mods/**'
jobs:
push_to_ghcr_io:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: get changed files
id: getfile
run: |
2021-10-15 19:39:05 +02:00
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)"
2021-09-12 15:36:09 +02:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }}
- name: find correct directory then build&push
run: |
for i in ${{ steps.getfile.outputs.files }}
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
push_to_dockerhub:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: get changed files
id: getfile
run: |
2021-10-15 19:41:24 +02:00
echo "::set-output name=files::$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} docker-mods/| xargs)"
2021-09-12 15:36:09 +02:00
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: find correct directory then build&push
run: |
for i in ${{ steps.getfile.outputs.files }}
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
2021-08-01 17:16:12 +02:00
done