diff --git a/.github/workflows/suggest-related-links.yml b/.github/workflows/suggest-related-links.yml index 58cac15..70e71d6 100644 --- a/.github/workflows/suggest-related-links.yml +++ b/.github/workflows/suggest-related-links.yml @@ -8,11 +8,6 @@ on: workflow_dispatch: schedule: - cron: '13 13 * * */7' - pull_request: - paths: - - '.github/workflows/suggest-related-links.yml' - - 'models/**' - - '!*.md' jobs: action: @@ -24,7 +19,7 @@ jobs: run: echo "${GITHUB_CONTEXT}" - name: Setup Python - if: github.event_name == 'issues' || github.event_name == 'pull_request' + if: github.event_name == 'issues' uses: actions/setup-python@v2.1.2 with: python-version: '3.8' @@ -39,26 +34,17 @@ jobs: - uses: peaceiris/actions-suggest-related-links@v1.0.0 - - name: Setup model - if: github.event_name == 'issues' || github.event_name == 'pull_request' - run: | - cd ~ - git clone https://github.com/peaceiris/actions-suggest-related-links.git - cd ./actions-suggest-related-links/models - git checkout v1.0.0 - python3 -m pip install -r ./requirements.txt - - name: fastText if: github.event_name == 'issues' run: | - cd ~/actions-suggest-related-links/models/fasttext - cp ~/actions-suggest-related-links-tmp/training-data.json . - cp ~/actions-suggest-related-links-tmp/input.txt . - python3 train.py -d training-data.json -test input.txt + git clone https://github.com/peaceiris/actions-suggest-related-links.git ~/asrl + cd ~/asrl/models/fasttext + git checkout 41db3bb + cp ~/actions-suggest-related-links-tmp/{training-data.json,input.txt} . + make train cp ./suggestions.json ~/actions-suggest-related-links-tmp/ - uses: peaceiris/actions-suggest-related-links@v1.0.0 - if: github.event_name != 'pull_request' with: mode: 'suggest' repository: 'peaceiris/actions-gh-pages' diff --git a/models/fasttext/Makefile b/models/fasttext/Makefile index 8f7f637..ff5db1c 100644 --- a/models/fasttext/Makefile +++ b/models/fasttext/Makefile @@ -5,3 +5,7 @@ build: .PHONY: run run: docker-compose run --rm dev bash + +.PHONY: train +train: + docker-compose run --rm dev python train.py -d training-data.json -test input.txt diff --git a/models/fasttext/docker-compose.yml b/models/fasttext/docker-compose.yml index 865fe35..d312bb0 100644 --- a/models/fasttext/docker-compose.yml +++ b/models/fasttext/docker-compose.yml @@ -2,7 +2,6 @@ version: '3' services: dev: - build: . image: docker.pkg.github.com/peaceiris/actions-suggest-related-links/asrl-fasttext:latest container_name: asrl_fasttext volumes: