Skip to content

Commit

Permalink
merge in main
Browse files Browse the repository at this point in the history
  • Loading branch information
indam23 committed Apr 15, 2021
2 parents baa7076 + 46c10b9 commit d61909d
Show file tree
Hide file tree
Showing 38 changed files with 1,201 additions and 480 deletions.
23 changes: 23 additions & 0 deletions .github/change_filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
nlu:
- 'data/nlu/*'
- 'config.yml'

core:
- 'data/rules/*'
- 'data/stories/*'
- 'config.yml'
- 'domain.yml'

training:
- 'data/**/*'
- 'domain.yml'
- 'config.yml'
- 'requirements.txt'

actions:
- 'actions/**/*'
- 'Dockerfile'

deployment:
- '.github/deployments/**/*'
- '.github/workflows/continuous_deployment.yml'
63 changes: 0 additions & 63 deletions .github/workflows/auto_merge.yml

This file was deleted.

162 changes: 0 additions & 162 deletions .github/workflows/build_and_deploy.yml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/continuous_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Continuous Deployment
on:
push:
branches:
- 'main'

jobs:
check_changed_files:
name: Check for file changes
runs-on: ubuntu-20.04
outputs:
training: ${{ steps.changed-files.outputs.training }}
actions: ${{ steps.changed-files.outputs.actions }}
steps:
- uses: actions/checkout@v2
- uses: RasaHQ/pr-changed-files-filter@c4f7116a04b8a4596313469429e2ad235f59d9c4
id: changed-files
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: .github/change_filters.yml
base: ${{ github.ref }}
build-push-action-server:
name: Build Action Server Docker Image
needs:
- check_changed_files
runs-on: ubuntu-latest
if: ${{ needs.check_changed_files.outputs.actions == 'true' }}
steps:
- name: Checkout git repository 🕝
uses: actions/checkout@v2

- name: Authenticate into Google Cloud Platform
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '275.0.0'
service_account_key: ${{ secrets.GCLOUD_AUTH }}

- name: Configure Docker to use Google Cloud Platform ☁️
run: |
gcloud auth configure-docker
- name: Pull Latest Image
run: |
docker pull gcr.io/replicated-test/rasa-demo:latest || true
- name: Set Build ID from run ID and number
run: echo "BUILD_NUMBER=$GITHUB_RUN_NUMBER-$GITHUB_RUN_ID" >> $GITHUB_ENV

- name: Build Image
run: |
docker build -t gcr.io/replicated-test/rasa-demo:run$BUILD_NUMBER -t gcr.io/replicated-test/rasa-demo:latest --cache-from gcr.io/replicated-test/rasa-demo:latest .
- name: Push PR Image to Google Cloud Container Registry
run: |
docker push gcr.io/replicated-test/rasa-demo
train-upload-model:
name: Train and Upload Model to Rasa X
runs-on: ubuntu-latest
needs:
- check_changed_files
if: ${{ needs.check_changed_files.outputs.training == 'true' }}
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade "pip<20"
pip install -r requirements-dev.txt
- name: Train Model
working-directory: ${{ github.workspace }}
run: |
rasa train
- name: Upload model
env:
RASA_X_API_TOKEN: ${{ secrets.RASA_X_API_TOKEN }}
working-directory: ${{ github.workspace }}
run: |
model_path=`ls models/*.tar.gz | head -n 1`
curl -k -F "model=@${model_path}" "https://website-demo.rasa.com/api/projects/default/models?api_token=${RASA_X_API_TOKEN}"
Loading

0 comments on commit d61909d

Please sign in to comment.