Skip to content

Commit

Permalink
Automated publishing, see https://github.com/manorrock/bengal-book
Browse files Browse the repository at this point in the history
  • Loading branch information
Automated publish committed Mar 19, 2024
1 parent 04dabe1 commit 8bdbf03
Show file tree
Hide file tree
Showing 35 changed files with 5,398 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

19 changes: 19 additions & 0 deletions bengal/book/_book/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18

# Install basic development tools
RUN apt update && \
apt install -y less man-db npm sudo

# Ensure default `node` user has access to `sudo`
ARG USERNAME=node
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Set `DEVCONTAINER` environment variable to help with orientation
ENV DEVCONTAINER=true

USER node
RUN cd $HOME && \
npm init --yes && \
npm install honkit --save-dev && \
npm install gitbook-plugin-hints --save-dev
8 changes: 8 additions & 0 deletions bengal/book/_book/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// See https://containers.dev/implementors/json_reference/ for configuration reference
{
"name": "Bengal Book project",
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "node"
}
28 changes: 28 additions & 0 deletions bengal/book/_book/.github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: publish
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Build with honkit and publish to Bengal website
run: |
npm install honkit
npm install gitbook-plugin-hints
npx honkit build
git clone https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_TOKEN }}@github.com/manorrock/website
cd website
rm -rf bengal/book || true
mkdir -p bengal/book
mv ../_book bengal/book
rm -rf .devcontainer
rm -rf .github
rm -rf .gitignore
git config --global user.email "[email protected]"
git config --global user.name "Automated publish"
git add .
git commit -a -m "Automated publishing, see https://github.com/manorrock/bengal-book"
git push
5 changes: 5 additions & 0 deletions bengal/book/_book/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_book/
nbproject/
node_modules/
package-lock.json
package.json
9 changes: 9 additions & 0 deletions bengal/book/_book/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributing

If you want to contribute to the Bengal Book please use VSCode with a DevContainer as it is setup with the tooling you need.

To serve up the book use:

```shell
npx honkit serve
```
10 changes: 10 additions & 0 deletions bengal/book/_book/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

README
======

To build the book you will need to install all the relevant tools,
or open it in a VSCode DevContainer.

Then to build use:

npx honkit serve
Loading

0 comments on commit 8bdbf03

Please sign in to comment.