import data #104
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
name: import data | |
on: | |
schedule: | |
- cron: "0 0 * * 0" | |
workflow_dispatch: | |
jobs: | |
biotools: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-biotools.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="biotools-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b biotools-import-branch | |
- name: import bio.tools data from server | |
uses: research-software-ecosystem/utils/biotools-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-biotools | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
commit_message: import bio.tools data on $(date) | |
branch: biotools-import-branch | |
create_branch: true | |
openebench: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-openebench.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="openebench-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b openebench-import-branch | |
- name: import OpenEBench data from server | |
uses: research-software-ecosystem/utils/openebench-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-openebench | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
commit_message: import OpenEBench data on $(date) | |
branch: openebench-import-branch | |
create_branch: true | |
bioconda: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-bioconda.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="bioconda-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b bioconda-import-branch | |
- name: import bioconda data from server | |
uses: research-software-ecosystem/utils/bioconda-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-bioconda | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
commit_message: import bioconda data on $(date) | |
branch: bioconda-import-branch | |
create_branch: true | |
biii: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-biii.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="biii-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b biii-import-branch | |
- name: import biii data from server | |
uses: research-software-ecosystem/utils/biii-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-biii | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
branch: biii-import-branch | |
create_branch: true | |
biocontainers: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-biocontainers.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="biocontainers-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b biocontainers-import-branch | |
- name: import biocontainers data from server | |
uses: research-software-ecosystem/utils/biocontainers-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-biocontainers | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
commit_message: import biocontainers data on $(date) | |
branch: biocontainers-import-branch | |
create_branch: true | |
galaxytool: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-galaxytool.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="galaxytool-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b galaxytool-import-branch | |
- name: import galaxy tool data from server | |
uses: research-software-ecosystem/utils/galaxytool-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-galaxytool | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
commit_message: import galaxy tools data on $(date) | |
branch: galaxytool-import-branch | |
create_branch: true | |
debian-med: | |
runs-on: ubuntu-latest | |
outputs: | |
commit_hash: ${{ steps.commit-and-push-debianmed.outputs.commit_hash }} | |
steps: | |
- name: checkout contents repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: delete previous import branch | |
run: | | |
branch_name="debianmed-import-branch" | |
# Check if the branch exists on the remote repository | |
if git rev-parse --verify --quiet "origin/$branch_name"; then | |
# The branch exists, so it can be safely deleted | |
git push origin --delete "$branch_name" | |
echo "Branch $branch_name has been deleted." | |
else | |
# The branch does not exist | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
- name: Create and checkout feature branch | |
run: git checkout -b debianmed-import-branch | |
- name: import Debian Med data | |
uses: research-software-ecosystem/utils/debian-med-import@main | |
with: | |
repo-user: ${{ secrets.GITHUB_USER }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit and Push Changes | |
id: commit-and-push-debianmed | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_user_name: Tools Platform Ecosystem bot | |
commit_user_email: tpe-bot@github.com | |
commit_author: Tools Platform Ecosystem bot <tpe-bot@github.com> | |
commit_message: import Debian Med tools data on $(date) | |
branch: debianmed-import-branch | |
create_branch: true | |
merge: | |
runs-on: ubuntu-latest | |
needs: | |
- biotools | |
- openebench | |
- bioconda | |
- biii | |
- biocontainers | |
- galaxytool | |
- debian-med | |
if: always() | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Merge feature branches | |
run: | | |
git config --local user.email "tpe-bot@github.com" | |
git config --local user.name "Tools Platform Ecosystem bot" | |
merge_branch_if_exists() { | |
local branch_name="$1" | |
# Check if the branch exists on the remote repository | |
if git ls-remote --exit-code --heads origin "$branch_name" &>/dev/null; then | |
# The branch exists on the remote, so it can be safely merged | |
git fetch origin "$branch_name" | |
git merge "origin/$branch_name" | |
echo "Merged $branch_name into the current branch." | |
else | |
# The branch does not exist on the remote | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
} | |
merge_branch_if_exists "biotools-import-branch" | |
merge_branch_if_exists "openebench-import-branch" | |
merge_branch_if_exists "bioconda-import-branch" | |
merge_branch_if_exists "biii-import-branch" | |
merge_branch_if_exists "biocontainers-import-branch" | |
merge_branch_if_exists "galaxytool-import-branch" | |
merge_branch_if_exists "debianmed-import-branch" | |
git push origin master | |
clean-branches: | |
runs-on: ubuntu-latest | |
needs: | |
- merge | |
if: always() | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Delete feature branches | |
run: | | |
git config --local user.email "tpe-bot@github.com" | |
git config --local user.name "Tools Platform Ecosystem bot" | |
delete_branch_if_exists() { | |
local branch_name="$1" | |
# Check if the branch exists on the remote repository | |
if git ls-remote --exit-code --heads origin "$branch_name" &>/dev/null; then | |
# The branch exists on the remote, so it can be deleted | |
git push origin --delete "$branch_name" | |
echo "Deleted $branch_name into the current branch." | |
else | |
# The branch does not exist on the remote | |
echo "Branch $branch_name does not exist on the remote repository." | |
fi | |
} | |
delete_branch_if_exists "biotools-import-branch" | |
delete_branch_if_exists "openebench-import-branch" | |
delete_branch_if_exists "bioconda-import-branch" | |
delete_branch_if_exists "biii-import-branch" | |
delete_branch_if_exists "biocontainers-import-branch" | |
delete_branch_if_exists "galaxytool-import-branch" | |
delete_branch_if_exists "debianmed-import-branch" |