Update github actions (#149) #272
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Create gh-pages | |
run: | | |
mkdir gh-pages | |
cp README.md gh-pages/ | |
echo "hereby.js.org" >> gh-pages/CNAME | |
cat > gh-pages/_config.yml <<EOF | |
plugins: | |
- jekyll-relative-links | |
relative_links: | |
enabled: true | |
collections: true | |
include: | |
- README.md | |
EOF | |
- name: tokei | |
run: | | |
curl -L https://github.com/XAMPPRocky/tokei/releases/download/v12.1.2/tokei-x86_64-unknown-linux-gnu.tar.gz | tar -zxv | |
./tokei -e '__*__' -o json src bin \ | |
| jq '{ schemaVersion: 1, label: "total lines", message: .Total.code | tostring, color: "brightgreen" }' \ | |
> gh-pages/tokei.json | |
- name: Deploy to GitHub Pages | |
if: success() | |
uses: crazy-max/ghaction-github-pages@c05ee637ec73429400a359430db8e5629f3f2564 # v4.0.0 | |
with: | |
target_branch: gh-pages | |
build_dir: gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |