Closed basit511 closed 3 weeks ago
Hi @basit511 - that's because GoogleCloudPlatform/github-actions/setup-gcloud@main
does not exist. The GitHub action is google-github-actions/setup-gcloud@v2
. Where did you find GoogleCloudPlatform/github-actions/setup-gcloud@main
?
Updated Action Configuration
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
service_account_key: ${{ secrets.GCLOUD_KEY }}
export_default_credentials: true
Update Workflow YAML
name: Deploy to GKE
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCLOUD_PROJECT_ID }}
service_account_key: ${{ secrets.GCLOUD_KEY }}
export_default_credentials: true
- name: Build Docker Image
run: |
docker build -t gcr.io/${{ secrets.GCLOUD_PROJECT_ID }}/hello.py:${{ github.sha }} .
docker push gcr.io/${{ secrets.GCLOUD_PROJECT_ID }}/hello.py:${{ github.sha }}
- name: Configure kubectl
run: |
gcloud container clusters get-credentials ${{ secrets.GCLOUD_CLUSTER_NAME }} --zone ${{ secrets.GCLOUD_ZONE }}
- name: Deploy to GKE
run: |
kubectl set image deployment/hello.py-deployment hello.py=gcr.io/${{ secrets.GCLOUD_PROJECT_ID }}/hello.py:${{ github.sha }}
TL;DR
Deploying a Docker Image to GCP - GCR
Expected behavior
No response
Observed behavior
No response
Action YAML
Log output
Additional information
No response