|
| 1 | +# This file was auto-generated by the Firebase CLI |
| 2 | +# https://github.com/firebase/firebase-tools |
| 3 | + |
| 4 | +name: Deploy to Firebase Hosting on PR |
| 5 | +'on': pull_request |
| 6 | +jobs: |
| 7 | + build_and_preview: |
| 8 | + if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v3 |
| 12 | + - name: Install Rust toolchain |
| 13 | + uses: dtolnay/rust-toolchain@master |
| 14 | + with: |
| 15 | + toolchain: nightly |
| 16 | + - run: cargo doc --no-deps --examples -Z rustdoc-scrape-examples |
| 17 | + - name: Copy plots directories |
| 18 | + run: | |
| 19 | + declare -A example_map |
| 20 | + example_map["01_orbit_prop"]="01_orbit_prop" |
| 21 | + example_map["02_jwst"]="02_jwst_covar_monte_carlo" |
| 22 | + |
| 23 | + declare -A special_cases |
| 24 | + special_cases["03_geo_analysis"]="03_geo_raise 03_geo_drift 03_geo_sk" |
| 25 | + |
| 26 | + for example_dir in examples/*; do |
| 27 | + example_name=$(basename $example_dir) |
| 28 | + if [ -d "$example_dir/plots" ]; then |
| 29 | + if [ -n "${example_map[$example_name]}" ]; then |
| 30 | + doc_name=${example_map[$example_name]} |
| 31 | + mkdir -p target/doc/$doc_name/plots |
| 32 | + cp -r $example_dir/plots/* target/doc/$doc_name/plots/ |
| 33 | + elif [ -n "${special_cases[$example_name]}" ]; then |
| 34 | + for target_folder in ${special_cases[$example_name]}; do |
| 35 | + mkdir -p target/doc/$target_folder/plots |
| 36 | + cp -r $example_dir/plots/* target/doc/$target_folder/plots/ |
| 37 | + done |
| 38 | + else |
| 39 | + echo "No mapping found for $example_name" |
| 40 | + fi |
| 41 | + fi |
| 42 | + done |
| 43 | + - uses: FirebaseExtended/action-hosting-deploy@v0 |
| 44 | + with: |
| 45 | + repoToken: '${{ secrets.GITHUB_TOKEN }}' |
| 46 | + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NYX_SPACE }}' |
| 47 | + projectId: nyx-space |
0 commit comments