Overleaf Development Image #26
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
name: Overleaf Development Image | |
on: | |
workflow_dispatch: | |
env: | |
GHCR_REGISTRY: ghcr.io | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image-name: | |
[ | |
web, | |
webpack, | |
real-time, | |
project-history, | |
notifications, | |
history-v1, | |
filestore, | |
document-updater, | |
docstore, | |
contacts, | |
chat, | |
clsi, | |
spelling | |
] | |
steps: | |
- name: "Check out code" | |
uses: actions/checkout@main | |
- name: "Login to GitHub Container Registry" | |
uses: docker/[email protected] | |
with: | |
registry: ${{env.GHCR_REGISTRY}} | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: "Clone Overleaf And Build" | |
run: | | |
git clone https://github.com/overleaf/overleaf ./overleaf | |
cp ./dev-patches/web-dockerfile/Dockerfile ./overleaf/services/web/Dockerfile | |
cd ./overleaf/develop/ | |
bin/build ${{matrix.image-name}} | |
- name: "Push Image" | |
run: | | |
docker tag develop-${{matrix.image-name}} ${{env.GHCR_REGISTRY}}/ayaka-notes/overleaf/dev/${{matrix.image-name}}:latest | |
docker push ${{env.GHCR_REGISTRY}}/ayaka-notes/overleaf/dev/${{matrix.image-name}}:latest | |
clean-image: | |
runs-on: ubuntu-latest | |
needs: build-image | |
steps: | |
- name: Delete 'untaged' containers | |
uses: snok/container-retention-policy@v2 | |
with: | |
image-names: overleaf/dev/* | |
cut-off: 1 min ago UTC | |
account-type: org | |
org-name: ayaka-notes | |
untagged-only: true | |
token: ${{ secrets.ORGTOKEN }} |