{"id":17498198,"url":"https://github.com/timreynolds/percy-google-cloud-build-example","last_synced_at":"2026-02-16T01:36:19.899Z","repository":{"id":43581656,"uuid":"164330041","full_name":"timReynolds/percy-google-cloud-build-example","owner":"timReynolds","description":"Example repository for using Percy.io with Google cloud build","archived":false,"fork":false,"pushed_at":"2023-01-04T02:58:16.000Z","size":9044,"stargazers_count":0,"open_issues_count":27,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-28T22:52:56.852Z","etag":null,"topics":["build","google","percy-io"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timReynolds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-06T17:33:51.000Z","updated_at":"2019-01-06T21:53:59.000Z","dependencies_parsed_at":"2023-02-01T18:16:24.498Z","dependency_job_id":null,"html_url":"https://github.com/timReynolds/percy-google-cloud-build-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timReynolds/percy-google-cloud-build-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fpercy-google-cloud-build-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fpercy-google-cloud-build-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fpercy-google-cloud-build-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fpercy-google-cloud-build-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timReynolds","download_url":"https://codeload.github.com/timReynolds/percy-google-cloud-build-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timReynolds%2Fpercy-google-cloud-build-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278245457,"owners_count":25955028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","google","percy-io"],"created_at":"2024-10-19T16:10:39.718Z","updated_at":"2025-10-04T00:10:35.059Z","avatar_url":"https://github.com/timReynolds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Percy.io Google Cloud Build (GCB) Example\n\nThis repository demonstrates the basics of using percy.io within Google Cloud Build. To prove this works the percy project is set to public [accessible here](https://percy.io/timReynolds/percy-google-cloud-build-example).\n\nUnlike other build environments each step runs inside it's own container requiring the percy step to run in a container that supports puppeteer. The default npm cloud builder image doesn't provide this support so instead [buildkites puppeteer](https://github.com/buildkite/docker-puppeteer) image is used. \n\nCloud build uses a `cloudbuild.yaml` file for it's definition that can be found in this repository. It doesn't include all steps you'd expect for a production build but instead just the bare minimal to run percy including a encrypted token. \n\nSteps to encrypt your percy token with Cloud KMS are outlined below, a full explanation of encrypted resources with KMS are included in the [cloud build documentation](https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials). \n\n*Warning: This example uses the google npm cloud builder for the npm install step and buildkite's puppeteer image to run percy. In a production setup I'd recommend ensuring the two containers uses the same linux distribution to ensure compatibility. This is achived by either creating your own npm cloud builder with puppeteer support or alternately use the buildkite image to perform all node related steps*\n\n### Encrypt percy token with KMS\n\nThe following `gcloud` commands will create a new keyring, cryptokey, provide the cloud build service account access to the key and lastly encrypt your percy token using the key. Before running ensure the KMS API is enabled in your GCP project. \n\nAfter execution include the outputted base64 string in your `cloudbuild.yaml` secrets section. \n\n```bash\nKEYRING_NAME=percy-google-cloud-build-key-ring\nKEY_NAME=percy-google-cloud-build-key\nGCB_SERVICE_ACCOUNT=[SERVICE-ACCOUNT]@cloudbuild.gserviceaccount.com\nPERCY_TOKEN=[TOKEN] # Only required if not already set  \n\ngcloud kms keyrings create $KEYRING_NAME --location=global\n\ngcloud kms keys create $KEY_NAME \\\n  --location=global \\\n  --keyring=$KEYRING_NAME \\\n  --purpose=encryption\n\ngcloud kms keys add-iam-policy-binding \\\n    $KEY_NAME --location=global --keyring=$KEYRING_NAME \\\n    --member=serviceAccount:$GCB_SERVICE_ACCOUNT \\\n    --role=roles/cloudkms.cryptoKeyDecrypter\n\necho -n $PERCY_TOKEN | gcloud kms encrypt \\ \n  --plaintext-file='-' \\\n  --ciphertext-file='-' \\ \n  --location=global \\\n  --keyring=$KEYRING_NAME \\\n  --key=$KEY_NAME | base64\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimreynolds%2Fpercy-google-cloud-build-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimreynolds%2Fpercy-google-cloud-build-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimreynolds%2Fpercy-google-cloud-build-example/lists"}