Skip to content

Commit

Permalink
testing 12
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaytonSmith committed Jun 12, 2024
1 parent 5bce4ae commit c5f50bd
Showing 1 changed file with 33 additions and 32 deletions.
65 changes: 33 additions & 32 deletions .github/workflows/docker_push_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,56 +84,57 @@ jobs:
# - name: Checkout repository
# uses: actions/checkout@v2

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v3
# with:
# images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build Docker image
run: |
docker build -t ${{ env.IMAGE_NAME }} -f ./src/backend/Dockerfile .
# - name: Build Docker image
# run: |
# docker build -t ${{ env.IMAGE_NAME }} -f ./src/backend/Dockerfile .

# - name: Pull docker hello-world image
# run: docker pull hello-world
# # - name: Pull docker hello-world image
# # run: docker pull hello-world

# - name: Tag Docker image
# run: |
# docker tag hello-world ${{ vars.REGISTRY }}/hello-world
# # - name: Tag Docker image
# # run: |
# # docker tag hello-world ${{ vars.REGISTRY }}/hello-world

# # # Save the SA key to a file so that it can be used by the docker build
# # - name: Save SA key to file
# # run: echo "${{ secrets.GCP_SA_KEY }}" > /tmp/gcp_sa_key.json

# # Save the SA key to a file so that it can be used by the docker build
# - name: Save SA key to file
# run: echo "${{ secrets.GCP_SA_KEY }}" > /tmp/gcp_sa_key.json
# # - name: Try auth again!
# # run: |
# # gcloud auth activate-service-account --key-file /tmp/gcp_sa_key.json
# # gcloud auth configure-docker --quiet
# # docker login -u _json_key -p "$(cat /tmp/gcp_sa_key.json)" https://gcr.io

# - name: Try auth again!
# # - name: Push Docker image
# # run: |
# # docker push ${{ vars.REGISTRY }}/hello-world

# - name: Tag Docker image
# run: |
# gcloud auth activate-service-account --key-file /tmp/gcp_sa_key.json
# gcloud auth configure-docker --quiet
# docker login -u _json_key -p "$(cat /tmp/gcp_sa_key.json)" https://gcr.io
# docker tag ${{ env.IMAGE_NAME }} ${{ steps.meta.outputs.tags }}

# - name: Push Docker image
# env:
# THE_TAGS: ${{ steps.meta.outputs.tags }}
# run: |
# docker push ${{ vars.REGISTRY }}/hello-world

- name: Tag Docker image
run: |
docker tag ${{ env.IMAGE_NAME }} ${{ steps.meta.outputs.tags }}
- name: Push Docker image
env:
THE_TAGS: ${{ steps.meta.outputs.tags }}
run: |
docker push ${{ steps.meta.outputs.tags }}
# docker push ${{ steps.meta.outputs.tags }}

# Deploy the image to Cloud Run
- name: Deploy to Cloud Run
run: |
gcloud run deploy ${{ env.IMAGE_NAME }} \
--project ${{ vars.GCP_PROJECT_ID }} \
--image ${{ steps.meta.outputs.tags }} \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--update-env-vars DATABASE_URL=${{ secrets.DATABASE_URL }},COHERE_API_KEY=${{ secrets.COHERE_API_KEY }} \
--memory 4Gi \
--cpu 4
--cpu 4 \
--max-instances 1

0 comments on commit c5f50bd

Please sign in to comment.