This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
Add script for migrating to HF Hub (#53) #39
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: Generate Dist | |
on: | |
push: | |
branches: [ master ] | |
paths: [ 'adapters/**', 'architectures/**', 'scripts/generate.py' ] | |
jobs: | |
generate: | |
if: github.repository_owner == 'Adapter-Hub' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install | |
run: | | |
pip install -r scripts/requirements.txt | |
- name: Run generation | |
run: | | |
python scripts/generate.py | |
- name: Commit | |
run: | | |
git config user.name "Adapter Hub Bert" | |
git config user.email "65732326+adapter-hub-bert@users.noreply.github.com" | |
git add dist | |
if [[ `git status --porcelain` ]]; then | |
git commit -m "Generate dist files." | |
git remote set-url origin https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/${{ github.repository }} | |
git push origin master | |
fi | |
- name: Trigger website build | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.BOT_TOKEN }} | |
repository: Adapter-Hub/website | |
event-type: build |