diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..f5b065c --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,30 @@ +name: Build docker image + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout main + uses: actions/checkout@v2 + - name: Docker login + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Setup buildx + uses: docker/setup-buildx-action@v1 + - name: Build docker image + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/huangfusl/template:${{ github.ref_name }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20e5436 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM texlive/texlive:latest + +# Install fonts +RUN sed -i 's/testing/stable/g' /etc/apt/sources.list \ + && echo "deb http://deb.debian.org/debian stable contrib" >> /etc/apt/sources.list \ + && apt update \ + && apt install ttf-mscorefonts-installer fonts-noto-cjk -y \ + && apt clean + +COPY . /template +ENV TEXINPUTS=/template//: + +VOLUME [ "/data" ] +WORKDIR /data \ No newline at end of file