Skip to content

Commit

Permalink
Switch from gitbook to mdbook
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo committed Jan 12, 2024
1 parent feffc72 commit 38a52c7
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to GitHub Pages

on:
# Triggers the workflow on push or pull request events but
# only for the default branch.
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
fetch:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Rust packages
run: |
curl --proto '=https' --tlsv1.2 -sSf https://rossmacarthur.github.io/install/crate.sh | bash -s -- --repo "rust-lang/mdBook" --bin mdbook --to ~/.cargo/bin
- name: Install gh-pages
run: |
npm install gh-pages@"~6.1.1"
- name: Build book
run: |
mdbook --version
mdbook build
- name: Set Git config
run: |
git config --global user.email "[email protected]"
git config --global user.name 'Automation'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
- name: Deploy to GitHub pages
run: |
npx gh-pages --message "Deploy docs" --no-history --dist build
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Run tests
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -14,8 +16,8 @@ jobs:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '12'
- name: Run ci
Expand Down
Empty file added .nojekyll
Empty file.
11 changes: 11 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[book]
multilingual = false
src = "guide"

[build]
build-dir = "build"
create-missing = false

[output.html]
git-repository-url = "https://github.com/projectfluent/fluent/"
edit-url-template = "https://github.com/projectfluent/fluent/edit/master/{path}"
1 change: 1 addition & 0 deletions guide/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Summary

* [Introduction](README.md)
* [Hello, world!](hello.md)
* [Writing Text](text.md)
* [Placeables](placeables.md)
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"bench": "node -r esm ./test/bench.js ./test/benchmarks/gecko_strings.ftl",
"build:guide": "gitbook build guide build/guide",
"build:guide": "mdbook build",
"build": "npm run --silent build:guide",
"ci": "npm run --silent lint && npm test && npm run --silent test:ebnf && npm run --silent test:validate",
"clean": "rm -rf build",
Expand Down Expand Up @@ -40,8 +40,7 @@
"eslint": "^6.7.2",
"@fluent/bundle": "^0.14.0",
"@fluent/syntax": "^0.14.0",
"gh-pages": "^2.1.1",
"gitbook-cli": "^2.3.2",
"gh-pages": "^6.1.1",
"json-diff": "^0.5.4"
},
"dependencies": {
Expand Down

0 comments on commit 38a52c7

Please sign in to comment.