Merge branch 'streetturtle:master' into master

This commit is contained in:
Augusto Gunsch 2022-01-23 21:38:19 -03:00 committed by GitHub
commit f7d7b3e6f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 0 deletions

View File

@ -8,6 +8,8 @@ on:
push:
branches:
- '*'
paths:
- '**.lua'
pull_request:
branches: [ master ]

35
.github/workflows/update-site.yml vendored Executable file
View File

@ -0,0 +1,35 @@
name: update site
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate md
run: ./scripts/update_site.sh
- name: Push to gh-pages branch
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add ./_widgets
git add ./assets/img
git stash
git fetch
echo "git checkout gh-pages"
git checkout gh-pages
rm -rf ./_widgets
rm -rf ./assets/img
ls -alF
echo "git stash pop"
git checkout stash -- ./_widgets
git checkout stash -- ./assets
git add ./_widgets
git add ./assets/img
git commit -m "update from master"
git push origin gh-pages

13
scripts/update_site.sh Executable file
View File

@ -0,0 +1,13 @@
mkdir ./_widgets
for D in *; do
if [[ -d "${D}" ]] && [[ ${D} == *"-widget"* ]]; then
echo "${D}"
cp ${D}/README.md ./_widgets/${D}.md
sed -i '1s/^/---\nlayout: page\n---\n/' ./_widgets/${D}.md
mkdir -p ./assets/img/screenshots/${D}
find ${D}/ \( -name '*.jpg' -o -name '*.png' -o -name '*.gif' \) -exec cp '{}' ./assets/img/screenshots/${D} \;
sed -i "s/](\.\(\/screenshots\)\{0,1\}/](..\/awesome-wm-widgets\/assets\/img\/screenshots\/$D/g" ./_widgets/${D}.md
fi
done