-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic template files #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! I left some comments ^^
.github/test.yaml
Outdated
list: | ||
needs: run_ci_check_job | ||
env: | ||
s3_bucket: s3://openproblems-data/resources_test/cell_cell_communication |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should extract the s3_bucket from the _viash.yaml
and fetch the bucket name from there. Partially related to viash-io/viash-actions#30. At the very least, we should read the task id and store it in an environment variable.
@@ -0,0 +1,72 @@ | |||
name: A unique identifier. Can only contain lowercase letters, numbers or underscores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't do this now, but I think we should try to move as many of these fields (if not all) to _viash.yaml
.
.github/build.yaml
Outdated
@@ -0,0 +1,122 @@ | |||
name: build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The github action is in the wrong directory ;)
.github/build.yaml
Outdated
- name: Determine version tag from branch name | ||
id: defaults | ||
run: | | ||
BRANCH_NAME=$(echo $GITHUB_REF | sed 's/refs\/heads\///') | ||
|
||
VERSION=${{ github.event.inputs.version }} | ||
if [ -z "$VERSION" ]; then | ||
VERSION="build-$BRANCH_NAME" | ||
fi | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
|
||
TARGET_BRANCH=${{ github.event.inputs.target_branch }} | ||
if [ -z "$TARGET_BRANCH" ]; then | ||
TARGET_BRANCH="build-$BRANCH_NAME" | ||
fi | ||
echo "target_branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT | ||
|
||
- name: Remove target folder from .gitignore | ||
run: | | ||
# allow publishing the target folder | ||
sed -i '/^\/target.*/d' .gitignore | ||
|
||
- uses: viash-io/viash-actions/ns-build@v5 | ||
with: | ||
config_mod: .functionality.version := '${{ steps.defaults.outputs.version }}' | ||
parallel: true | ||
|
||
- name: Deploy to target branch | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: . | ||
publish_branch: ${{ steps.defaults.outputs.target_branch }} | ||
|
||
- id: ns_list | ||
uses: viash-io/viash-actions/ns-list@v5 | ||
with: | ||
platform: docker | ||
src: src | ||
format: json | ||
|
||
- id: set_matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on simplifying this a little bit
.github/test.yaml
Outdated
if [[ "$pull_request" != "null" && "$GITHUB_REF_NAME" != "main" && "${{ github.event_name == 'push' }}" == "true" && "${{ !contains(github.event.head_commit.message, 'ci force') }}" == "true" ]]; then | ||
echo "check=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "check=true" >> $GITHUB_OUTPUT | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GTHB_PAT }} | ||
|
||
# phase 1 | ||
list: | ||
needs: run_ci_check_job | ||
env: | ||
s3_bucket: s3://openproblems-data/resources_test | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.run_ci_check_job.outputs.run_ci == 'true' }} | ||
|
||
outputs: | ||
matrix: ${{ steps.set_matrix.outputs.matrix }} | ||
cache_key: ${{ steps.cache.outputs.cache_key }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
|
||
- uses: christian-ci/action-yaml-github-output@v2 | ||
with: | ||
file_path: _viash.yaml | ||
|
||
- uses: viash-io/viash-actions/setup@v5 | ||
|
||
- uses: viash-io/viash-actions/project/sync-and-cache-s3@v5 | ||
id: cache | ||
with: | ||
s3_bucket: $s3_bucket/$NAME | ||
dest_path: resources | ||
cache_key_prefix: resources__ | ||
|
||
- id: ns_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
No description provided.