Skip to content

Commit

Permalink
typst
Browse files Browse the repository at this point in the history
Signed-off-by: 117503445 <[email protected]>
  • Loading branch information
117503445 committed Aug 29, 2023
1 parent 86521d1 commit 740a171
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/docker-typst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: docker-typst

on:
schedule:
- cron: "0 0 * * *" # everyday at 00:00, UTC+0
push:
branches:
- "master"
- "dev"
pull_request:
branches:
- "master"
- "dev"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# https://github.com/docker/login-action
- name: Login to ACR
uses: docker/login-action@v2
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALI_REGISTRY_USERNAME }}
password: ${{ secrets.ALI_REGISTRY_PASSWORD }}

# https://github.com/docker/metadata-action
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
117503445/dev-typst
registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-typst
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest
# https://github.com/docker/build-push-action
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: "./typst/Dockerfile"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ docker pull 117503445/dev-golang
docker pull 117503445/dev-latex
docker pull 117503445/dev-python
docker pull 117503445/dev-rust
docker pull 117503445/dev-typst

# China mirror
docker pull registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-base && docker image tag registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-base 117503445/dev-base
Expand All @@ -19,6 +20,7 @@ docker pull registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-golang && doc
docker pull registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-latex && docker image tag registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-latex 117503445/dev-latex
docker pull registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-python && docker image tag registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-python 117503445/dev-python
docker pull registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-rust && docker image tag registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-rust 117503445/dev-rust
docker pull registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-typst && docker image tag registry.cn-hangzhou.aliyuncs.com/117503445-mirror/dev-typst 117503445/dev-typst
```

## usage
Expand All @@ -30,6 +32,7 @@ docker run -it -v $PWD:/root/project 117503445/dev-latex
docker run -d --name dev-kde -p 6080:6080 -e VNC_PASSWD=password 117503445/dev-kde
docker run -it -v $PWD:/root/project 117503445/dev-python
docker run -it -v $PWD:/root/project 117503445/dev-rust
docker run -it -v $PWD:/root/project 117503445/dev-typst
```

## local build
Expand All @@ -43,6 +46,7 @@ docker build -f ./kde/Dockerfile -t 117503445/dev-kde .

docker build -f ./python/Dockerfile -t 117503445/dev-python .
docker build -f ./rust/Dockerfile -t 117503445/dev-rust .
docker build -f ./typst/Dockerfile -t 117503445/dev-typst .
```

## dev container
Expand Down
6 changes: 6 additions & 0 deletions typst/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM 117503445/dev-base
LABEL maintainer="117503445"
RUN echo "Server = https://mirrors.kernel.org/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
RUN pacman -Syu typst noto-fonts noto-fonts-cjk adobe-source-han-sans-cn-fonts noto-fonts-emoji --noconfirm
COPY typst/fonts /root/.local/share/fonts
RUN echo "Server = https://mirrors.ustc.edu.cn/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
Binary file added typst/fonts/Microsoft YaHei Mono.ttf
Binary file not shown.
Binary file not shown.

0 comments on commit 740a171

Please sign in to comment.