Deploy Pipeline #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Pipeline | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
env: | |
REGION: us-central1 | |
jobs: | |
deploy: | |
name: Deploy Containerized App | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Authenticate to Google Cloud | |
uses: "google-github-actions/auth@v2" | |
with: | |
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}" | |
- name: Configure Docker | |
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet | |
- name: Build Docker Container | |
run: docker build . -t ${{ secrets.CONTAINER_IMAGE_URL }} | |
- name: Push Docker Container to Google Cloud | |
run: docker push ${{ secrets.CONTAINER_IMAGE_URL }} | |
- name: Deploy Container to Google Cloud Run | |
run: gcloud run deploy imaginate-api --image ${{ secrets.CONTAINER_IMAGE_URL }} --region ${{ env.REGION }} | |
- name: Add API Url to API Spec | |
run: python scripts/add_api_url.py openapi.yml ${{ secrets.API_URL }} | |
- uses: actions/checkout@v4 | |
- name: Create and Deploy API-Config | |
run: gcloud api-gateway api-configs create api-config --api=api --openapi-spec=openapi.yml |