update for tests #13
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: Utility | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_run: | |
workflows: | |
- CI | |
branches: | |
- main | |
types: | |
- completed | |
jobs: | |
push_to_hub: | |
runs-on: ubuntu-latest | |
env: | |
REPO_NAME: "layout-utility" | |
DIR_NAME: "layout_utility" | |
SRC_DIR: ./github-repo | |
DST_DIR: ./huggingface-repo | |
steps: | |
- name: Checkout GitHub repository | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ env.SRC_DIR }} | |
- name: Checkout Huggingface repository | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
HF_USERNAME: ${{ secrets.HF_USERNAME }} | |
run: | | |
git clone https://${HF_USERNAME}:${HF_TOKEN}@huggingface.co/spaces/${HF_USERNAME}/${REPO_NAME} ${DST_DIR} | |
- name: Export requirements.txt | |
run: | | |
pip install poetry | |
poetry -C ${SRC_DIR} export -f requirements.txt --output ${DST_DIR}/requirements.txt --without-hashes | |
- name: Copy files to Huggingface repository | |
env: | |
HF_USERNAME: ${{ secrets.HF_USERNAME }} | |
HF_EMAIL: ${{ secrets.HF_EMAIL }} | |
SCRIPTS_DIR: ${{ env.SRC_DIR }}/scripts | |
run: | | |
makefile_path=${SRC_DIR}/Makefile | |
make -f ${makefile_path} deploy REPO_NAME=${REPO_NAME} DIR_NAME=${DIR_NAME} |