We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Automate Builds

Now that we've built the Docker image locally, let's build it automatically on every push to the main branch.

Assignment

Use the setup-gcloud action to authenticate with GCP.

I recommend using the simple service account key JSON setup.

Creating a Service Account

Add the Key As a Secret in GitHub Actions

Update Your GitHub Action Workflow

gcloud builds submit --tag REGION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG .

You can copy/paste your actual value for the tag from your Artifact Registry repo page in the GCP console.

Paste the URL of your GitHub repo into the box and run the GitHub checks.