Skip to content

Commit

Permalink
ci: using self hosted repl
Browse files Browse the repository at this point in the history
  • Loading branch information
MR-Addict committed Feb 21, 2024
1 parent a2dae56 commit 1ab1356
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .drone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ WORKDIR /app
COPY . .
COPY assets/bin/* /usr/local/bin/
RUN chmod u+x /usr/local/bin/mdbook*
RUN mdbook build
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/MR-Addict/mdbook-repl.git -b gh-pages --depth 1
RUN echo 'src = "/embed/"' >> book.toml && mdbook build && mv mdbook-repl/embed book

FROM nginx:stable-alpine-slim
EXPOSE 80
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,25 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Build
run: chmod u+x assets/bin/* && cp assets/bin/* /usr/local/bin && mdbook build
- name: Setup book
run: |
chmod u+x assets/bin/* && cp assets/bin/* /usr/local/bin
git clone https://github.com/MR-Addict/mdbook-repl.git -b gh-pages --depth 1
- name: Build books
run: |
mdbook build --dest-dir github
echo 'src = "/embed/"' >> book.toml && mdbook build --dest-dir vercel && mv mdbook-repl/embed vercel
- uses: amondnet/vercel-action@v25
with:
vercel-args: --prod
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
working-directory: ./book
working-directory: ./vercel

- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
publish_dir: ./github
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
| :-------------- | :----- | :-------------------------------------------------------------------------- |
| mdbook | 0.4.37 | [仓库地址](https://github.com/rust-lang/mdBook/releases/tag/v0.4.37) |
| mdbook-embedify | 0.2.7 | [仓库地址](https://github.com/MR-Addict/mdbook-embedify/releases/tag/0.2.7) |
| mdbook-repl | 0.2.0 | [仓库地址](https://github.com/MR-Addict/mdbook-repl/releases/tag/0.2.0) |
| mdbook-repl | 0.2.1 | [仓库地址](https://github.com/MR-Addict/mdbook-repl/releases/tag/0.2.1) |
Binary file modified assets/bin/mdbook-repl
Binary file not shown.

0 comments on commit 1ab1356

Please sign in to comment.