feat(rf): add a MicrowaveModeSpec for RF specific mode information #206
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "docs/tidy3d/sync-to-readthedocs-repo" | |
on: | |
workflow_dispatch: | |
inputs: | |
target_branch: | |
description: 'Target mirror repo branch. Defaults to source branch/tag.' | |
required: false | |
type: string | |
push: | |
branches: | |
- main | |
- latest | |
- develop | |
- 'pre/*' | |
- 'demo/*' | |
tags: | |
- 'v*' | |
- 'demo/*' | |
jobs: | |
extract_branch_or_tag: | |
outputs: | |
ref_name: ${{ steps.extract.outputs.ref_name }} | |
runs-on: ubuntu-latest | |
steps: | |
- id: extract | |
name: Extract branch or tag name | |
shell: bash | |
run: | | |
REF_NAME="${GITHUB_REF#refs/*/}" | |
echo "ref_name=$REF_NAME" >> $GITHUB_OUTPUT | |
echo "Extracted ref: $REF_NAME" | |
build-and-deploy: | |
permissions: | |
contents: write | |
needs: extract_branch_or_tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: full-checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
token: ${{ secrets.GH_PAT }} | |
fetch-depth: 0 | |
ref: ${{ needs.extract_branch_or_tag.outputs.ref_name }} | |
fetch-tags: true | |
- name: push-mirror-repo | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
SOURCE_REF: ${{ needs.extract_branch_or_tag.outputs.ref_name }} | |
TARGET_BRANCH_INPUT: ${{ github.event.inputs.target_branch }} | |
run: | | |
echo "Source reference: $SOURCE_REF" | |
git pull origin "$SOURCE_REF" | |
git remote add mirror https://github.com/flexcompute-readthedocs/tidy3d-docs.git | |
if [[ -n "$TARGET_BRANCH_INPUT" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
echo "Manual trigger detected. Pushing contents of '$SOURCE_REF' to remote branch '$TARGET_BRANCH_INPUT'." | |
git push mirror "$SOURCE_REF:refs/heads/$TARGET_BRANCH_INPUT" --force | |
else | |
echo "Automatic trigger or manual run without target. Pushing '$SOURCE_REF' to the same ref on the mirror." | |
# This preserves the original behavior: pushes a branch to a branch, or a tag to a tag. | |
git push mirror "$SOURCE_REF" --force | |
fi |