From 80c9f9a464489cf57b496931d1aa0ac81a2211bd Mon Sep 17 00:00:00 2001 From: daquinteroflex Date: Thu, 8 Aug 2024 09:35:23 +0100 Subject: [PATCH] :wrench: Fix tag sync alongside branch sync --- .github/workflows/sync-to-readthedocs-repo.yaml | 15 ++++++++++++--- docs/notebooks | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-to-readthedocs-repo.yaml b/.github/workflows/sync-to-readthedocs-repo.yaml index 941ad4e17..9a90762ac 100644 --- a/.github/workflows/sync-to-readthedocs-repo.yaml +++ b/.github/workflows/sync-to-readthedocs-repo.yaml @@ -42,6 +42,16 @@ jobs: token: ${{ secrets.GH_PAT }} ref: ${{ needs.extract_branch_or_tag.outputs.ref_name }} + - name: Push corresponding reference to mirror repo if a branch + if: contains(github.ref, 'refs/heads/') + run: | + git fetch --unshallow origin ${{ needs.extract_branch_or_tag.outputs.ref_name }} + git pull origin ${{ needs.extract_branch_or_tag.outputs.ref_name }} + git remote add mirror https://github.com/flexcompute-readthedocs/tidy3d-docs.git + git push mirror ${{ needs.extract_branch_or_tag.outputs.ref_name }} --force # overwrites always + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Conditional Checkout for Tag - name: Checkout Tag if tag-triggered-sync if: contains(github.ref, 'refs/tags/') @@ -53,10 +63,9 @@ jobs: ref: ${{ needs.extract_branch_or_tag.outputs.ref_name }} fetch-tags: true - - name: Push corresponding reference to mirror repo + - name: Push corresponding reference to mirror repo if a tag + if: contains(github.ref, 'refs/tags/') run: | - git fetch --unshallow origin ${{ needs.extract_branch_or_tag.outputs.ref_name }} - git pull origin ${{ needs.extract_branch_or_tag.outputs.ref_name }} git remote add mirror https://github.com/flexcompute-readthedocs/tidy3d-docs.git git push mirror ${{ needs.extract_branch_or_tag.outputs.ref_name }} --force # overwrites always env: diff --git a/docs/notebooks b/docs/notebooks index 96905e6f3..53381257a 160000 --- a/docs/notebooks +++ b/docs/notebooks @@ -1 +1 @@ -Subproject commit 96905e6f3c81c09437ceff59aef3e51efe17e5cc +Subproject commit 53381257a25e92d21d3c710e5e5e31ddc83e9a75