Merge pull request #148 from praekeltfoundation/test-postgres #166
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: Build model | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-model: | |
runs-on: ubuntu-20.04 | |
needs: test | |
strategy: | |
matrix: | |
bot: ['base', 'hh'] | |
lang: ['eng'] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build model | |
run: | | |
rasa train --data ${{ matrix.bot }}/data -d ${{ matrix.bot }}/domain-${{ matrix.lang }}.yml -c ${{ matrix.bot }}/config.yml --fixed-model-name `date "+%Y%m%d-%H%M%S"`-${{ matrix.bot }}-${{ matrix.lang }} | |
- name: Push model | |
uses: jakejarvis/s3-sync-action@master | |
env: | |
AWS_S3_BUCKET: "healthcheck-rasa-models-ml" | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: "af-south-1" | |
SOURCE_DIR: "models" | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
bot: ['base', 'hh'] | |
lang: ['eng'] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7.7 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
pip install -r requirements-actions.txt | |
- name: Test | |
run: | | |
./test.sh ${{ matrix.bot }} ${{ matrix.lang }} | |
build: | |
runs-on: ubuntu-latest | |
needs: build-model | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: docker/setup-buildx-action@v1 | |
- name: construct image metadata | |
id: meta | |
uses: crazy-max/ghaction-docker-meta@v2 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
praekeltfoundation/healthcheck-rasa | |
tags: | | |
type=sha | |
- name: login to ghcr | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: login to docker hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |