Skip to content

Commit

Permalink
add on demand updater
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed May 12, 2022
1 parent a252ba0 commit 4ea3096
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
File renamed without changes.
78 changes: 78 additions & 0 deletions .github/workflows/update-on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: update-software

on:
workflow_dispatch:
inputs:
scraper:
description: 'Scraper'
required: true
type: choice
options:
- molssi
- joss
- imperial
- rsnl
- biotools
- hal
- ropensci

jobs:
UpdateSoftware:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install Research Software Encyclopedia
run: |
sudo apt-get update && sudo apt-get install -y python3 python3-pip python3-setuptools
sudo pip3 install rse[all]
rse --version
- name: Run Latest Scrapers
env:
SCRAPER: ${{ github.event.inputs.scraper }}
RSE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rse scrape ${SCRAPER}
rse export repos.txt --force
- name: Export site to docs/
uses: rseng/[email protected]
with:
config: rse.ini
export_dir: docs
force: true
prefix: software
host: https://rseng.github.io

- name: Checkout New Branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_AGAINST: "master"
run: |
printf "GitHub Actor: ${GITHUB_ACTOR}\n"
export BRANCH_FROM="on-demand-update/software-$(date '+%Y-%m-%d')"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git branch
git checkout -b "${BRANCH_FROM}" || git checkout "${BRANCH_FROM}"
git branch
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add database/*
git add docs/*
if git diff-index --quiet HEAD --; then
printf "No changes\n"
else
printf "Changes\n"
git commit -m "On demand deployment to update software database $(date '+%Y-%m-%d')"
git push origin "${BRANCH_FROM}"
fi
echo "PULL_REQUEST_FROM_BRANCH=${BRANCH_FROM}" >> $GITHUB_ENV
- name: Open Pull Request
uses: vsoch/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: "master"
File renamed without changes.

0 comments on commit 4ea3096

Please sign in to comment.