Skip to content

Commit

Permalink
Add actions for docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
am009 committed May 11, 2024
1 parent d43e22f commit 6a507c4
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker-hub-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Image for Backend

on:
push:
tags:
- '**'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: 'backend'
sparse-checkout-cone-mode: false
# All files should be moved to the project root.
- name: Move app files to root
run: |
ls -lah
shopt -s dotglob
mv backend/* .
rm -rf backend
ls -lah
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: am009
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: am009/latexdiff-web-backend:latest,am009/latexdiff-web-backend:${{ github.ref_name }}
39 changes: 39 additions & 0 deletions .github/workflows/docker-hub-worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Image for Worker

on:
push:
tags:
- '**'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: 'worker'
sparse-checkout-cone-mode: false
# All files should be moved to the project root.
- name: Move app files to root
run: |
ls -lah
shopt -s dotglob
mv worker/* .
rm -rf worker
ls -lah
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: am009
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: am009/latexdiff-web-worker:latest,am009/latexdiff-web-worker:${{ github.ref_name }}
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
sparse-checkout: 'frontend'
sparse-checkout-cone-mode: false
# All files should be moved to the project root.
- name: Move mobile app files to root
- name: Move app files to root
run: |
ls -lah
shopt -s dotglob
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function Home() {
}, []);

const [fields, setFields] = useState({
"api_endpoint": "latexdiff.cn",
"api_endpoint": "backend.latexdiff.cn",
"main_tex": "main.tex",
"other_cmdlines": "--latexopt -shell-escape --ignore-latex-errors",
"download_diff_proj": false,
Expand Down

0 comments on commit 6a507c4

Please sign in to comment.