diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a8cda7c..9447609 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,12 +15,14 @@ jobs: - name: Checkout uses: actions/checkout@master - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@v0 + # Authenticate with Google Cloud + - uses: google-github-actions/auth@v2 with: - service_account_email: ${{ secrets.GCP_EMAIL }} - service_account_key: ${{ secrets.GCP_CREDENTIALS }} - export_default_credentials: true + credentials_json: ${{ secrets.GCP_CREDENTIALS }} + + # Setup gcloud CLI + - name: 'Set up Cloud SDK' + uses: 'google-github-actions/setup-gcloud@v2' # Configure Docker with Credentials - name: Configure Docker @@ -31,13 +33,13 @@ jobs: - name: Build & Publish run: | gcloud config set project ${{ secrets.GCP_PROJECT }} - gcloud builds submit --tag gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.GCP_APPLICATION }} + gcloud builds submit --region=us-central1 --tag us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT }}/${{ secrets.GCP_APPLICATION }}/${{ secrets.GCP_APPLICATION }} gcloud config set run/region us-central1 # Deploy the Docker image to the GKE cluster - name: Deploy run: | - gcloud run deploy ${{ secrets.GCP_APPLICATION }} --image gcr.io/${{ secrets.GCP_PROJECT }}/${{ secrets.GCP_APPLICATION }} \ + gcloud run deploy ${{ secrets.GCP_APPLICATION }} --image us-central1-docker.pkg.dev/${{ secrets.GCP_PROJECT }}/${{ secrets.GCP_APPLICATION }}/${{ secrets.GCP_APPLICATION }} \ --platform managed \ --allow-unauthenticated \ --memory 256M