Skip to content

Commit c839121

Browse files
committed
Update pandoc
1 parent 04f59e9 commit c839121

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
- uses: actions/checkout@v2
1414

1515
- name: Set up Docker Build
16-
uses: docker/setup-buildx-action@v1
16+
uses: docker/setup-buildx-action@v2
1717

1818
- name: Login to GitHub Container Registry
19-
uses: docker/login-action@v1
19+
uses: docker/login-action@v2
2020
with:
2121
registry: ghcr.io
2222
username: ${{ github.actor }}
@@ -27,7 +27,12 @@ jobs:
2727
continue-on-error: true
2828

2929
- name: Build Docker image
30-
run: docker-compose build
30+
uses: docker/build-push-action@v3
31+
with:
32+
file: ./docker/Dockerfile
33+
platforms: linux/amd64
34+
push: true
35+
tags: ghcr.io/rust-lang-ja/book-ja-pdf:latest
3136

3237
- name: PDF build
3338
run: docker-compose up --abort-on-container-exit

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ services:
99
- ghcr.io/rust-lang-ja/book-ja-pdf:latest
1010
volumes:
1111
- .:/workdir
12+
tty: true

docker/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM pandoc/core:2.16
1+
FROM alpine:3.16
22

33
LABEL maintainer="YOSHIMRUA Hikaru <yyu [at] mental.poker>"
44

@@ -21,6 +21,12 @@ ENV FONT_DEPS \
2121

2222
ENV FONT_PATH /usr/share/fonts/
2323

24+
ARG TARGETARCH
25+
26+
ENV PANDOC_VERSION 2.18
27+
ENV PANDOC_DOWNLOAD_URL https://github.com/jgm/pandoc/releases/download/$PANDOC_VERSION/pandoc-$PANDOC_VERSION-linux-$TARGETARCH.tar.gz
28+
ENV PANDOC_ROOT /usr/local/bin/pandoc
29+
2430
ENV PERSISTENT_DEPS \
2531
py-pip \
2632
rust \
@@ -82,6 +88,11 @@ RUN mkdir -p $FONT_PATH && \
8288
fc-cache -f -v && \
8389
apk del .font-deps
8490

91+
# Install Pandoc
92+
RUN wget -qO- "$PANDOC_DOWNLOAD_URL" | tar -xzf - && \
93+
cp pandoc-$PANDOC_VERSION/bin/pandoc $PANDOC_ROOT && \
94+
rm -Rf pandoc-$PANDOC_VERSION/
95+
8596
# Install Pandocfilter
8697
COPY requirements.txt ./
8798
RUN pip install --upgrade pip && \

setup.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ if [[ ! -d "./target" ]]; then
4343
fi
4444

4545
# Copy markdown files to the working directory
46-
for f in ./book-ja/docs/markdown/*.md; do
46+
for f in ./book-ja/src/*.md; do
4747
cp "$f" target/
4848
done
49-
cp ./book-ja/src/SUMMARY.md ./target/
5049

5150
python3 python/fix_table.py < target/appendix-02-operators.md > target/tmp.md
5251
mv target/tmp.md target/appendix-02-operators.md

0 commit comments

Comments
 (0)