Mechanistic info OPDM2 #350
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: Update data | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| pull_request: | |
| branches: main | |
| paths: | |
| - "data/**" | |
| - "scripts/**" | |
| - "workflow/**" | |
| - ".github/workflows/**" | |
| schedule: | |
| - cron: "45 2 2 * *" # Run at 2:45 am on the second day of each month | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Debug dump | |
| uses: crazy-max/ghaction-dump-context@v2 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Miniconda environment | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| activate-environment: strchive | |
| environment-file: scripts/environment.yml | |
| python-version: 3.12 | |
| auto-activate-base: false | |
| - run: | | |
| conda info | |
| # - name: Check loci and update bed files (short) | |
| # if: ${{ github.event_name == 'pull_request'}} | |
| # run: snakemake --cores all --config stages="skip-refs" | |
| - name: Check loci, fetch citations already in the loci json, and update bed files (shorter) | |
| if: ${{ github.event_name == 'pull_request'}} | |
| run: snakemake --cores all --config stages="old-refs" | |
| # Enable this step to open an SSH session for debugging | |
| # - name: SSH debug | |
| # uses: mxschmitt/action-tmate@v3 | |
| - name: Find new literature (intermediate) | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: | | |
| conda init | |
| source /home/runner/.bashrc | |
| conda activate strchive | |
| snakemake --cores all --config stages="new-refs" | |
| - name: Update all literature (long) | |
| if: ${{ github.event_name == 'schedule' }} | |
| run: | | |
| conda init | |
| source /home/runner/.bashrc | |
| conda activate strchive | |
| snakemake --cores all | |
| - name: Open pull request with updated files | |
| if: ${{ !(github.event_name == 'pull_request') }} | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| branch: update-data | |
| title: Update Literature | |
| body-path: .github/PULL_REQUEST_TEMPLATE/literature_PR_template.md | |
| - name: Commit updated files to current pull request | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: Update data |