forked from Sage-Bionetworks/data_curator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from nf-osi/develop
Update prod
- Loading branch information
Showing
4 changed files
with
69 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Update source model for dev | ||
|
||
# Update model download_url in `schematic_config.yml` | ||
# to point to new source URL in `develop` branch. | ||
on: | ||
# Note: can also run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
inputs: | ||
source: | ||
description: 'URL of new source' | ||
required: true | ||
|
||
env: | ||
SOURCE_URL: ${{ github.event.inputs.source }} | ||
|
||
jobs: | ||
update-model: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Check out development branch under $GITHUB_WORKSPACE | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: develop | ||
persist-credentials: false | ||
|
||
# Check steps matter more for rare occasions of manual input | ||
# vs. programmatic dispatches | ||
- name: Check that source link works | ||
run: wget $SOURCE_URL -O model.json | ||
|
||
# Check format as can be easy to not grab the actual raw.github URL | ||
- name: Check is JSON | ||
run: cat model.json | python -m simplejson.tool > validated.json | ||
|
||
- name: Update config | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq -i '.model.input.download_url = strenv(SOURCE_URL)' schematic_config.yml | ||
|
||
- name: Commit files | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "nfosi-service" | ||
git commit -m "Update model source in config" -a | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: ${{ github.ref }} | ||
github_token: ${{ secrets.SERVICE_TOKEN }} | ||
|
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
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