Skip to content

Update actions/checkout action to v4 #31

Update actions/checkout action to v4

Update actions/checkout action to v4 #31

Workflow file for this run

name: Publish to GitHub Pages
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: "Publish"
steps:
- name: Install Dokkoo
run: |
curl -s https://raw.githubusercontent.com/Dirout/dokkoo/master/Cargo.toml --output Cargo.toml > /dev/null
version=$( awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2) }' Cargo.toml )
curl -s -L https://github.com/Dirout/dokkoo/releases/download/v${version}/dokkoo_${version}_amd64.deb --output dokkoo_${version}_amd64.deb > /dev/null
sudo apt-get -qq install ./dokkoo_${version}_amd64.deb > /dev/null
printf "Installed Dokkoo v${version}"
- name: Checkout Mokk
uses: actions/checkout@v4
with:
path: ./mokk
- name: Checkout GitHub Pages environment
uses: actions/checkout@v4
with:
ref: gh-pages
path: ./gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
find ./gh-pages -mindepth 1 ! -regex '^./gh-pages/.git\(/.*\)?' -delete
cd ./mokk
dokkoo build .
cd ../
cp -ar ./mokk/output/* ./gh-pages
if [ -f "./mokk/postbuild.sh" ]; then
chmod +x ./mokk/postbuild.sh && ./mokk/postbuild.sh
fi
touch ./gh-pages/.nojekyll
tee -a ./gh-pages/.nojekyll > /dev/null <<EOT
EOT
- name: Publish
run: |
cd ./gh-pages
git config --global user.name 'Dokkoo'
git config --global user.email '[email protected]'
git add -A
git diff --quiet && git diff --staged --quiet || git commit -am "Publish Mokk to GitHub Pages"
git push