Skip to content

Commit 5880fe8

Browse files
committed
create github action to create a test session
1 parent a109cac commit 5880fe8

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/create_session.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create test session
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
student_id:
7+
description: 'Student ID'
8+
required: true
9+
school_id:
10+
description: 'School ID'
11+
required: true
12+
lesson_id:
13+
description: 'Lesson ID'
14+
required: true
15+
16+
jobs:
17+
invoke_state_machine:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
- name: Extract Branch Name
24+
id: branch_name
25+
run: |
26+
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
27+
echo "TEST_SESSION_STATE_MACHINE_ARN=${{ secrets.TEST_SESSION_STATE_MACHINE_ARN }}" >> $GITHUB_ENV
28+
echo "AI_TUTOR_ID=${{ secrets.AI_TUTOR_ID }}" >> $GITHUB_ENV
29+
echo "NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
30+
31+
- name: Configure AWS Credentials
32+
uses: aws-actions/configure-aws-credentials@v1
33+
with:
34+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
35+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+
aws-region: eu-west-1
37+
38+
- name: AWS CLI v2
39+
uses: imehedi/actions-awscli-v2@latest
40+
with:
41+
args: stepfunctions start-execution --state-machine-arn ${{ env.TEST_SESSION_STATE_MACHINE_ARN }} --input "{\"time\":\"${{ env.NOW }}\",\"number_of_students\":1,\"prompt_version\":\"${{ env.BRANCH_NAME }}\",\"tutor_id\":${{ env.AI_TUTOR_ID }},\"school_id\":${{ github.event.inputs.school_id }},\"student_ids\":[${{ github.event.inputs.student_id }}],\"lesson_ids\":[${{ github.event.inputs.lesson_id }}]}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

0 commit comments

Comments
 (0)