Skip to content

Commit

Permalink
run bin scripts in any dir now
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Jul 9, 2024
1 parent f0f9f2c commit ca0b02d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/blogtini.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,20 @@ jobs:
- name: Blogtini SEO head elements & sitemap
run: |
set -x
# get pkgs
sudo apt-get install -yqq zsh yq
# get deno
# get & setup deno
curl -fsSL https://deno.land/install.sh | sh
export DENO_INSTALL="/home/runner/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
# get files & dir layout set up
mkdir -p bin js
mv _blogtini/bin/* bin/
mv _blogtini/js/blogtini.js js/
rm -rf _blogtini
# setup SEO headers and create sitemap
./bin/ssr.sh
if [ ! -e sitemap.xml ]; then ./bin/sitemap; fi
# setup SEO headers & create sitemap
./_blogtini/bin/ssr.sh
if [ ! -e sitemap.xml ]; then ./_blogtini/bin/sitemap; fi
# cleanup, remove .git/ etc..
rm -rf bin .[^.]*
rm -rf _blogtini .[^.]*
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
6 changes: 4 additions & 2 deletions bin/sitemap
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/zsh -e

mydir=${0:a:h}
cd $mydir/..
if [ ! -e config.yml ]; then
echo run this script from the top-level of your repo
exit 1
fi

NAME=$(git config remote.origin.url |cut -f2 -d: |cut -d/ -f1)
REPO=$(git config remote.origin.url |cut -f2 -d: |cut -d/ -f2)
Expand Down

0 comments on commit ca0b02d

Please sign in to comment.