Skip to content

Commit

Permalink
使用自定义gitbook镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Apr 6, 2024
1 parent 0dce2c3 commit 4085a31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ jobs:
run: rm -rf output
- name: Build
run: npm run docs:build
# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./output

- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
Expand Down
28 changes: 4 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
FROM lscr.io/linuxserver/calibre:latest AS build-stage
ENV NODE_VERSION=10.24.1
ENV DEBIAN_FRONTEND noninteractive
RUN ebook-convert --version
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
&& apt-get update \
&& apt-get install --force-yes --no-install-recommends wget fonts-wqy-microhei \
libgl1-mesa-glx libegl1 libxkbcommon0 libopengl0 -y \
&& apt-get clean
FROM yunnysunny/gitbook:latest AS build-stage

SHELL ["/bin/bash", "-c"]
RUN wget https://mirrors.huaweicloud.com/nodejs/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz
RUN mkdir -p /usr/local/node && tar -zxvf node-v${NODE_VERSION}-linux-x64.tar.gz -C /usr/local/node
ENV PATH="/usr/local/node/node-v${NODE_VERSION}-linux-x64/bin/:${PATH}"

RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/
RUN npm install gitbook-cli -g
RUN gitbook fetch 3.2.3

RUN useradd -ms /bin/bash gitbook
RUN chown gitbook:gitbook -R /opt

USER gitbook
RUN gitbook current
WORKDIR /opt
COPY . /opt
RUN gitbook pdf .
WORKDIR /opt
COPY . /opt
RUN gitbook pdf .
Expand Down

0 comments on commit 4085a31

Please sign in to comment.