Skip to content

Commit

Permalink
Merge pull request #1518 from LizenzFass78851/workflow
Browse files Browse the repository at this point in the history
Optimize Automatic Workflow to Update *.md's with updated links
  • Loading branch information
RPiList authored Mar 24, 2024
2 parents 82a918a + 785fd7a commit cd8f9b9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 80 deletions.
5 changes: 4 additions & 1 deletion .github/scripts/gen_blocklisten.md.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e # Beende das Skript bei einem Fehler

# Voreinstellungen
SUCHVERZEICHNIS=Blocklisten
Expand All @@ -10,7 +11,9 @@ TEMPLATE_S2=./Template/$PATCHTHEFILE/02
LINKS=/tmp/$SUCHVERZEICHNIS.txt

# Hole die Links
rm $LINKS
if [ -e "$LINKS" ]; then
rm "$LINKS"
fi

find ./$SUCHVERZEICHNIS/* -name '*' -type f \
| grep -v ".md" \
Expand Down
5 changes: 4 additions & 1 deletion .github/scripts/gen_dnsmasq_readme.md.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e # Beende das Skript bei einem Fehler

# Voreinstellungen
SUCHVERZEICHNIS=DNSMASQ
Expand All @@ -10,7 +11,9 @@ TEMPLATE_S2=./Template/$SUCHVERZEICHNIS/$PATCHTHEFILE/02
LINKS=/tmp/$SUCHVERZEICHNIS.txt

# Hole die Links
rm $LINKS
if [ -e "$LINKS" ]; then
rm "$LINKS"
fi

find ./$SUCHVERZEICHNIS/* -name '*' -type f \
| grep -v ".md" \
Expand Down
71 changes: 0 additions & 71 deletions .github/workflows/gen_blocklisten.md.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
name: gen_dnsmasq_readme.md
name: generate selected *.md files

on:
push:
branches: [ master ]
paths:
- '.github/workflows/gen_dnsmasq_readme.md.yml'
- '.github/workflows/gen_md_files.yml'

- '.github/scripts/gen_blocklisten.md.sh'
- 'Template/Blocklisten.md/*'

- '.github/scripts/gen_dnsmasq_readme.md.sh'
- 'Template/DNSMASQ/readme.md/*'

schedule:
- cron: '20 12 * * *'
workflow_dispatch:

env:
SCRIPT: .github/scripts/gen_dnsmasq_readme.md.sh
SCRIPT01: .github/scripts/gen_blocklisten.md.sh
SCRIPT02: .github/scripts/gen_dnsmasq_readme.md.sh

jobs:
build:
generate-and-deploy:
container:
image: ubuntu:22.04

runs-on: ubuntu-latest
if: github.repository == 'RPiList/specials'

steps:

- name: key
id: key
run: |
Expand Down Expand Up @@ -53,7 +57,9 @@ jobs:
run: |
export LANG=en_US.utf8
[ "${{ github.workflow }}" != "${{ steps.key.outputs.key }}" ] && c=5 || c=1
seq $c | while read x; do chmod +x ${{ env.SCRIPT }} && ./${{ env.SCRIPT }}; done
seq $c | while read x; do echo run ${{ env.SCRIPT01 }} && chmod +x ${{ env.SCRIPT01 }} && ./${{ env.SCRIPT01 }}; done
seq $c | while read x; do echo run ${{ env.SCRIPT02 }} && chmod +x ${{ env.SCRIPT02 }} && ./${{ env.SCRIPT02 }}; done
- name: commit
env:
Expand Down

0 comments on commit cd8f9b9

Please sign in to comment.