|
7 | 7 | - 'samples/retrieval-chain/**' |
8 | 8 | pull_request: |
9 | 9 | branches: [ main ] |
10 | | - workflow_dispatch: |
11 | | - inputs: |
12 | | - index_name: |
13 | | - description: 'Index name to query' |
14 | | - required: false |
15 | | - default: 'ECCN' |
16 | | - query: |
17 | | - description: 'Query to search for' |
18 | | - required: false |
19 | | - default: 'What is the ECCN for a laptop?' |
20 | | - k: |
21 | | - description: 'Number of results to return' |
22 | | - required: false |
23 | | - default: '3' |
24 | | - |
25 | | -env: |
26 | | - REGISTRY: ghcr.io |
27 | | - IMAGE_NAME: ${{ github.repository }}/retrieval-chain |
28 | 10 |
|
29 | 11 | jobs: |
30 | 12 | test-retrieval-chain: |
|
34 | 16 | - name: Checkout code |
35 | 17 | uses: actions/checkout@v4 |
36 | 18 |
|
37 | | - # - name: Change to retrieval-chain directory |
38 | | - # run: cd samples/retrieval-chain |
39 | | - |
40 | 19 | - name: Set up Docker Buildx |
41 | 20 | uses: docker/setup-buildx-action@v3 |
42 | 21 |
|
|
68 | 47 | -e BASE_URL="${{ secrets.UIPATH_BASE_URL }}" \ |
69 | 48 | retrieval-chain:test \ |
70 | 49 | /app/startup.sh --index_name "${{ github.event.inputs.index_name }}" --query "${{ github.event.inputs.query }}" --k ${{ github.event.inputs.k }} |
71 | | -
|
72 | | - build-and-push: |
73 | | - runs-on: ubuntu-latest |
74 | | - needs: test-retrieval-chain |
75 | | - if: github.ref == 'refs/heads/main' |
76 | | - permissions: |
77 | | - contents: read |
78 | | - packages: write |
79 | | - |
80 | | - steps: |
81 | | - - name: Checkout code |
82 | | - uses: actions/checkout@v4 |
83 | | - |
84 | | - - name: Log in to Container Registry |
85 | | - uses: docker/login-action@v3 |
86 | | - with: |
87 | | - registry: ${{ env.REGISTRY }} |
88 | | - username: ${{ github.actor }} |
89 | | - password: ${{ secrets.GITHUB_TOKEN }} |
90 | | - |
91 | | - - name: Extract metadata |
92 | | - id: meta |
93 | | - uses: docker/metadata-action@v5 |
94 | | - with: |
95 | | - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
96 | | - tags: | |
97 | | - type=ref,event=branch |
98 | | - type=ref,event=pr |
99 | | - type=sha,prefix=sha- |
100 | | - type=raw,value=latest,enable={{is_default_branch}} |
101 | | - |
102 | | - - name: Build and push Docker image |
103 | | - uses: docker/build-push-action@v5 |
104 | | - with: |
105 | | - context: ./samples/retrieval-chain |
106 | | - push: true |
107 | | - tags: ${{ steps.meta.outputs.tags }} |
108 | | - labels: ${{ steps.meta.outputs.labels }} |
109 | | - build-args: | |
110 | | - CLIENT_ID=${{ secrets.UIPATH_CLIENT_ID }} |
111 | | - CLIENT_SECRET=${{ secrets.UIPATH_CLIENT_SECRET }} |
112 | | - BASE_URL=${{ secrets.UIPATH_BASE_URL }} |
113 | | -
|
114 | | - deploy: |
115 | | - runs-on: ubuntu-latest |
116 | | - needs: build-and-push |
117 | | - if: github.ref == 'refs/heads/main' |
118 | | - environment: production |
119 | | - |
120 | | - steps: |
121 | | - - name: Deploy to production |
122 | | - run: | |
123 | | - echo "🚀 Deploying retrieval chain to production..." |
124 | | - echo "Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" |
125 | | - echo "Add your deployment commands here" |
126 | | - # Example: Deploy to Azure Container Instances, AWS ECS, or Kubernetes |
0 commit comments