Skip to content

update-software

update-software #135

name: update-software
on:
workflow_dispatch:
schedule:
# Weekly
- cron: 0 0 * * 0
jobs:
UpdateSoftware:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Research Software Encyclopedia
run: |
sudo apt-get update && sudo apt-get install -y python3 python3-pip python3-setuptools
git clone https://github.com/rseng/rse /tmp/rse
cd /tmp/rse
sudo pip3 install .[all]
#sudo pip3 install rse[all]
rse --version
- name: Run Latest Scrapers
env:
RSE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rse scrape ascl || true
rse scrape imperial || true
rse scrape joss || true
rse scrape molssi || true
rse scrape rsnl || true
rse scrape biotools || true
rse scrape biogrids || true
rse scrape hal || true
rse scrape ropensci || true
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="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 "Automated 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/pull-request-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_BRANCH: "master"