Trying github pages #1
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: GH Pages Deploy | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v4 | |
- name: Build 🔧 | |
run: cargo build --release | |
- name: Add paths | |
run: echo "::add-path::$GITHUB_WORKSPACE/target/release" | |
- name: Prepare site 🏗️ | |
run: | | |
cp -R example marmitesite | |
rm marmitesite/content/* | |
rm -rf marmitesite/site | |
echo "---\ntitle:Markdown Makes Sites\ndate:2024-10-16\ntags:marmite,ssg\n---\n" > marmitesite/content/markdown-makes-sites.md | |
cat README.md >> marmitesite/content/markdown-makes-sites.md | |
echo "name:Marmite Site\ntagline: Site generated with marmite" > marmitesite/marmite.yaml | |
- name: Build site 🏗️ | |
run: cd marmitesite && marmite . site && cd .. | |
- name: Deploy to GitHub Pages 🚀 | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./marmitesite/site |