-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (31 loc) · 998 Bytes
/
overleaf-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Overleaf Sync with Git
on:
schedule:
- cron: "*/15 * * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Fetch the latest version from overleaf server
uses: subhamx/overleaf_sync_with_git@master
with:
OVERLEAF_PROJECT_ID: ${{ secrets.OVERLEAF_PROJECT_ID }}
OVERLEAF_COOKIE: ${{ secrets.OVERLEAF_COOKIE }}
- name: Upload to Project Artifacts
uses: actions/upload-artifact@v2
with:
name: project
path: ./artifacts/
- uses: actions/checkout@v2
with:
path: repo/
- run: |
cd repo/
mkdir -p overleaf_remote_src
cp -r ../artifacts/* ./overleaf_remote_src
git config user.name "Overleaf Sync Bot"
git config user.email "actions@github.com"
git add .
if [[ $(git diff HEAD --stat) == '' ]]; then (echo 'Working tree is clean')
else (git commit -m "Sync with overleaf remote" && git push) fi