name: Rasa Pro CI/CD Pipeline
on:
push:
branches:
- main
paths:
- 'data/**'
- 'domain/**'
jobs:
train_test_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Pull Rasa Pro image
run: |
docker pull europe-west3-docker.pkg.dev/rasa-releases/rasa-pro/rasa-pro:3.8.0-latest
- name: Train Rasa model with Rasa Pro
run: |
docker run -v ${GITHUB_WORKSPACE}:/app \
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
-e RASA_PRO_LICENSE=${RASA_PRO_LICENSE} \
-e RASA_TELEMETRY_ENABLED=false \
europe-west3-docker.pkg.dev/rasa-releases/rasa-pro/rasa-pro:3.8.0-latest \
train --domain /app/domain --data /app/data --out /app/models
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
RASA_PRO_LICENSE: ${{ secrets.RASA_PRO_LICENSE }}
- name: Start Action Server and Test Rasa model with E2E tests
run: |
# Start the action server in the background
docker run -d -p 5055:5055 --name action_server <YOUR-ACTION-SERVER-IMAGE>
echo "Waiting for action server to be ready..."
timeout=60
while ! curl --output /dev/null --silent --fail http://localhost:5055/health; do
printf '.'
sleep 5
timeout=$((timeout-5))
if [ "$timeout" -le 0 ]; then
echo "Action server did not become ready in time."
echo "Action server logs:"
docker logs action_server
exit 1
fi
done
echo "Action server is ready."
docker run -v ${GITHUB_WORKSPACE}:/app \
--link action_server:action_server \
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
-e RASA_PRO_LICENSE=${RASA_PRO_LICENSE} \
-e RASA_TELEMETRY_ENABLED=false \
europe-west3-docker.pkg.dev/rasa-releases/rasa-pro/rasa-pro:3.8.0-latest \
test e2e /app/tests/e2e_test_cases.yml --model /app/models --endpoints /app/endpoints.yml
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
RASA_PRO_LICENSE: ${{ secrets.RASA_PRO_LICENSE }}
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0.4.0
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Configure Google Cloud project
run: |
echo $GCP_SA_KEY | gcloud auth activate-service-account --key-file=-
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
- name: Upload model to Google Cloud Storage
run: |
gsutil cp -r models/* gs://my-model-storage/