forked from overleaf/overleaf
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
254 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: build and push sharelatex-base image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
revision: | ||
description: 'image revision number' | ||
required: true | ||
default: '1' | ||
type: string | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: lcpu-club/sharelatex-base | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
strategy: | ||
matrix: | ||
version: ["latest",2022,2020] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
labels: | | ||
org.opencontainers.image.title=sharelatex-base | ||
org.opencontainers.image.description=base image for overleaf | ||
#- name: Set up QEMU | ||
# uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Prepare to build | ||
run: | | ||
cp ${{ github.workspace }}/server-ce/.dockerignore ${{ github.workspace }} | ||
- name: Build and push | ||
if: ${{ matrix.version != 'latest' }} | ||
uses: docker/build-push-action@v6 | ||
with: | ||
provenance: false | ||
build-args: | | ||
TEXLIVE_MIRROR=https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${{ matrix.version }}/tlnet-final | ||
TEXLIVE_VERSION=${{ matrix.version }} | ||
push: true | ||
context: ${{ github.workspace }} | ||
file: ${{ github.workspace }}/server-ce/Dockerfile-base | ||
#platforms: linux/amd64 | ||
tags: | | ||
ghcr.io/lcpu-club/sharelatex-base:${{ matrix.version }} | ||
ghcr.io/lcpu-club/sharelatex-base:${{ matrix.version }}.${{ inputs.revision }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: | | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex-base:${{ matrix.version }}.${{ inputs.revision }} | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex-base:${{ matrix.version }} | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex-base:latest | ||
cache-to: type=inline | ||
- name: Get current year | ||
if: ${{ matrix.version == 'latest' }} | ||
id: date | ||
run: echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT | ||
- name: Build and push | ||
if: ${{ matrix.version == 'latest' }} | ||
uses: docker/build-push-action@v6 | ||
with: | ||
provenance: false | ||
build-args: | | ||
TEXLIVE_MIRROR=https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet | ||
TEXLIVE_VERSION=${{ steps.date.outputs.year }} | ||
push: true | ||
context: ${{ github.workspace }} | ||
file: ${{ github.workspace }}/server-ce/Dockerfile-base | ||
#platforms: linux/amd64 | ||
tags: | | ||
ghcr.io/lcpu-club/sharelatex-base:latest | ||
ghcr.io/lcpu-club/sharelatex-base:${{ steps.date.outputs.year }}.${{ inputs.revision }} | ||
ghcr.io/lcpu-club/sharelatex-base:${{ steps.date.outputs.year }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: | | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex-base:${{ steps.date.outputs.year }}.${{ inputs.revision }} | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex-base:${{ steps.date.outputs.year }} | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex-base:latest | ||
cache-to: type=inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: build and push sharelatex image | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: lcpu-club/sharelatex | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
labels: | | ||
org.opencontainers.image.title=overleaf | ||
org.opencontainers.image.description=overleaf | ||
images: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
type=ref,event=branch | ||
#- name: Set up QEMU | ||
# uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Prepare to build | ||
run: | | ||
cp ${{ github.workspace }}/server-ce/.dockerignore ${{ github.workspace }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
provenance: false | ||
build-args: | | ||
OVERLEAF_BASE=ghcr.io/lcpu-club/sharelatex-base:latest | ||
MONOREPO_REVISION=${{ github.sha }} | ||
push: true | ||
context: ${{ github.workspace }} | ||
file: ${{ github.workspace }}/server-ce/Dockerfile | ||
#platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: | | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex:latest | ||
type=registry,ref=ghcr.io/lcpu-club/sharelatex:main | ||
cache-to: type=inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/bash | ||
# Usage: | ||
# 1. Add font source to .env | ||
# 2. Build OCI Images | ||
# 1) To build overleaf image, run ./deploy.sh | ||
# 2) To also build base image, run ./deploy.sh REV_NUMBER VERSIONS... | ||
# e.g. ./deploy.sh 2 latest 2023 2022 2021 2020 | ||
|
||
source .env | ||
|
||
# download fonts | ||
curl "$FONT_URL" --output fonts.zip | ||
|
||
mkdir tmp_fonts | ||
unzip fonts.zip -d tmp_fonts | ||
mv tmp_fonts/fonts/* fonts | ||
|
||
rm -rf tmp_fonts fonts.zip | ||
|
||
cd server-ce | ||
|
||
for version in "${@:2}" | ||
do | ||
VERSION=$version REV=$1 make build-base | ||
done | ||
|
||
make build-community |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# equivalent to -gt option. Used to prevent latexmk from skipping recompilation | ||
# of output.log and output.pdf | ||
$go_mode = 3; | ||
$pdflatex = 'pdflatex -shell-escape %O %S'; | ||
$xelatex = 'xelatex -shell-escape %O %S'; | ||
$lualatex = 'lualatex -shell-escape %O %S'; | ||
$latex = 'latex -shell-escape %O %S'; |