From 37c7dc283f3aef97b08b4508ece2fe64c8400394 Mon Sep 17 00:00:00 2001 From: Benedikt Schesch Date: Wed, 1 May 2024 23:28:07 -0700 Subject: [PATCH] Added correct ci/cd --- .github/workflows/push-plots-to-paper.yml | 29 +++++++---------------- .gitignore | 1 + 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/push-plots-to-paper.yml b/.github/workflows/push-plots-to-paper.yml index 7b162e6966..aa3a76db70 100644 --- a/.github/workflows/push-plots-to-paper.yml +++ b/.github/workflows/push-plots-to-paper.yml @@ -4,49 +4,36 @@ on: push: branches: - main # Set this to match the branch name you use - - automatic_plot_upload jobs: update-overleaf: runs-on: ubuntu-latest steps: + - uses: GuillaumeFalourd/setup-rsync@v1.2 - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Git Config + - name: Setup Git Config and Credentials run: | git config --global user.email "github-cicd-bot@example.com" git config --global user.name "GitHub CI/CD Bot" - - name: Setup .netrc for Git authentication - env: - OVERLEAF_TOKEN: ${{ secrets.OVERLEAF_TOKEN }} - run: | - cat << EOF > $HOME/.netrc - machine git.overleaf.com - login $OVERLEAF_TOKEN - password x-oauth-basic - EOF - chmod 600 $HOME/.netrc - - name: Create directory for Overleaf Repository - run: mkdir -p ${{ github.workspace }}/AST-Merging-Evaluation-Paper + run: mkdir -p ../AST-Merging-Evaluation-Paper - name: Clone Overleaf Repository env: - OVERLEAF_GIT_REPO: ${{ secrets.OVERLEAF_REPO_URL }} + OVERLEAF_GIT_REPO: ${{ secrets.OVERLEAF_GIT_REPO }} run: | - git clone $OVERLEAF_GIT_REPO ${{ github.workspace }}/AST-Merging-Evaluation-Paper + git clone ${OVERLEAF_GIT_REPO} ../AST-Merging-Evaluation-Paper - name: Run make command to copy plots run: make copy-paper - - name: Change directory to Overleaf repository - run: cd ${{ github.workspace }}/AST-Merging-Evaluation-Paper - + # Commit and push the changes to Overleaf if needed - name: Commit and Push to Overleaf run: | + cd ../AST-Merging-Evaluation-Paper git add . - git commit -m "Automated plot updates by GitHub CI/CD Bot" - git push origin master + git diff --staged --exit-code || (git commit -m "Automated plot updates by GitHub CI/CD Bot" && git push origin master) diff --git a/.gitignore b/.gitignore index 282a71e677..bafc21a4fa 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ cache*.tar cache.tar output.txt replay_logs/ +my.secrets output/ merge_repo/