Spaces:
Sleeping
Sleeping
Siddhharth B commited on
Updated main.yml -> added code for aws (# ed)
Browse files- .github/workflows/main.yml +61 -0
.github/workflows/main.yml
CHANGED
|
@@ -18,3 +18,64 @@ jobs:
|
|
| 18 |
env:
|
| 19 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 20 |
run: git push --force https://SID2702:$HF_TOKEN@huggingface.co/spaces/SID2702/CV_Process main
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
env:
|
| 19 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 20 |
run: git push --force https://SID2702:$HF_TOKEN@huggingface.co/spaces/SID2702/CV_Process main
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
# name: Deploy Application Docker Image to EC2 instance
|
| 25 |
+
|
| 26 |
+
# on:
|
| 27 |
+
# push:
|
| 28 |
+
# branches: [main]
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
# jobs:
|
| 32 |
+
# Continuous-Integration:
|
| 33 |
+
# runs-on: ubuntu-latest
|
| 34 |
+
|
| 35 |
+
# steps:
|
| 36 |
+
# - name: Checkout
|
| 37 |
+
# uses: actions/checkout@v2
|
| 38 |
+
|
| 39 |
+
# - name: Configure AWS credentials
|
| 40 |
+
# uses: aws-actions/configure-aws-credentials@v1
|
| 41 |
+
# with:
|
| 42 |
+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
| 43 |
+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
| 44 |
+
# aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
| 45 |
+
|
| 46 |
+
# - name: Login to Amazon ECR
|
| 47 |
+
# id: login-ecr
|
| 48 |
+
# uses: aws-actions/amazon-ecr-login@v1
|
| 49 |
+
|
| 50 |
+
# - name: Build, tag, and push image to Amazon ECR
|
| 51 |
+
# id: build-image
|
| 52 |
+
# env:
|
| 53 |
+
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
| 54 |
+
# ECR_REPOSITORY: ${{ secrets.ECR_REPO }}
|
| 55 |
+
# IMAGE_TAG: latest
|
| 56 |
+
# run: |
|
| 57 |
+
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
| 58 |
+
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
| 59 |
+
# echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
|
| 60 |
+
|
| 61 |
+
# Continuous-Deployment:
|
| 62 |
+
# needs: Continuous-Integration
|
| 63 |
+
# runs-on: self-hosted
|
| 64 |
+
# steps:
|
| 65 |
+
# - name: Checkout
|
| 66 |
+
# uses: actions/checkout@v3
|
| 67 |
+
|
| 68 |
+
# - name: Configure AWS credentials
|
| 69 |
+
# uses: aws-actions/configure-aws-credentials@v1
|
| 70 |
+
# with:
|
| 71 |
+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
| 72 |
+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
| 73 |
+
# aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
|
| 74 |
+
|
| 75 |
+
# - name: Login to Amazon ECR
|
| 76 |
+
# id: login-ecr
|
| 77 |
+
# uses: aws-actions/amazon-ecr-login@v1
|
| 78 |
+
|
| 79 |
+
# - name: Run Docker Image to serve users
|
| 80 |
+
# run: |
|
| 81 |
+
# docker run -d -e AWS_ACCESS_KEY_ID="${{ secrets.AWS_ACCESS_KEY_ID }}" -e AWS_SECRET_ACCESS_KEY="${{ secrets.AWS_SECRET_ACCESS_KEY }}" -e AWS_DEFAULT_REGION="${{ secrets.AWS_DEFAULT_REGION }}" -e PINECONE_API_KEY="${{ secrets.PINECONE_API_KEY }}" -e OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" -p 8080:8080 "${{ steps.login-ecr.outputs.registry }}"/"${{ secrets.ECR_REPO }}":latest
|