-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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,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.