-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a sample
dolphin_config.yaml
to the docs, GHA to auto-update (#438
) * Add a sample `dolphin_config.yaml` to the docs, GHA to auto-update * add link to readme to sample file * fix two warnings from mkdocs * update for merged main * remove actual creation time, subject to change * move the new job into existing workflow * Revert "move the new job into existing workflow" This reverts commit a0b0b2c. * add bash line * fix the `work_directory` resolving * add `base` to PR GHA * cache mamba envs for the day
- Loading branch information
1 parent
5849d7c
commit bd9be1d
Showing
6 changed files
with
428 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Update Default Config | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
update-config: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup environment | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: conda-env.yml | ||
environment-name: dolphin-env | ||
cache-environment-key: environment-${{ steps.date.outputs.date }} | ||
cache-downloads-key: downloads-${{ steps.date.outputs.date }} | ||
generate-run-shell: false | ||
create-args: ${{ matrix.deps.spec }} | ||
condarc: | | ||
channels: | ||
- conda-forge | ||
- name: Install | ||
run: | | ||
pip install --no-deps . | ||
- name: Generate default config | ||
run: | | ||
dolphin config --print-empty -o temp_config.yaml | ||
sed -e '/creation_time_utc:/d' \ | ||
-e 's|work_directory:.*|work_directory: .|' \ | ||
temp_config.yaml > docs/sample_dolphin_config.yaml | ||
- name: Check for changes | ||
id: git-check | ||
run: | | ||
git add docs/sample_dolphin_config.yaml | ||
git diff --staged --exit-code || echo "changes=true" >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
if: steps.git-check.outputs.changes == 'true' | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: Update sample_dolphin_config.yaml | ||
title: 'Update `sample_dolphin_config.yaml`' | ||
body: | | ||
This is an auto-update docs/sample_dolphin_config.yaml file based on the latest changes. | ||
branch: update-default-config | ||
delete-branch: true | ||
base: ${{ github.head_ref || github.ref_name }} |
This file contains 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
Oops, something went wrong.