Skip to content

Merge pull request #53 from drivecore/feature/provider-docs #31

Merge pull request #53 from drivecore/feature/provider-docs

Merge pull request #53 from drivecore/feature/provider-docs #31

Workflow file for this run

name: Deploy Documentation to Cloud Run
on:
push:
branches:
- main
workflow_dispatch:
env:
REGION: us-central1
GAR_HOSTNAME: us-central1-docker.pkg.dev
PROJECT_ID: drivecore-primary
SERVICE_NAME: mycoder-docs
jobs:
deploy:
name: Deploy to Cloud Run
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Configure Docker for GCP
run: |
gcloud auth configure-docker $GAR_HOSTNAME --quiet
- name: Set image path
run: echo "IMAGE_PATH=$GAR_HOSTNAME/$PROJECT_ID/shared-docker-registry/$SERVICE_NAME:${{ github.sha }}" >> $GITHUB_ENV
- name: Build and push Docker container
run: |
docker build -t ${{ env.IMAGE_PATH }} .
docker push ${{ env.IMAGE_PATH }}
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v2
with:
service: ${{ env.SERVICE_NAME }}
region: ${{ env.REGION }}
image: ${{ env.IMAGE_PATH }}
flags: '--allow-unauthenticated'
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}