Skip to content

Commit

Permalink
🔧 Fix tag sync alongside branch sync
Browse files Browse the repository at this point in the history
  • Loading branch information
daquinteroflex authored and momchil-flex committed Aug 12, 2024
1 parent 61966a9 commit 80c9f9a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/sync-to-readthedocs-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand All @@ -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:
Expand Down

0 comments on commit 80c9f9a

Please sign in to comment.