Skip to content

Commit

Permalink
Trying github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rochacbruno committed Oct 16, 2024
1 parent 46a7b30 commit 5916983
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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
4 changes: 2 additions & 2 deletions example/marmite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
# - ["Path", "/relative-path"]
# - ["External", "https://example.com"]

data:
foo: bar
# data:
# foo: bar

0 comments on commit 5916983

Please sign in to comment.