In GitHub, go to your team's repository. Click on "Code" then on "SSH" and copy the output.
Open Cloud Shell by going to https://shell.cloud.google.com. Make sure you are in the correct account!
In the terminal, type git clone and then paste what you copied from GitHub. You should see something like this, with your GitHub org and repository name:
git clone git@github.com:Github-Org-Name/my-team-repository.gitHit enter, and then use cd to change into your team's repository.
cd my-team-repositoryNote: This only needs to be done ONCE. Make sure the person running the code has Owners permission on the GCP project in IAM.
Fill in the bash variables at the top of run-setup.sh.
PROJECT_ID: The name of your GCP project, such asmelissakohltechx24.PROJECT_NUMBER: The project number for the GCP project, found at https://console.cloud.google.com/welcome.SERVICE_NAME: The website name for your webapp! NO uppercase letters or underscores. Use lowercase letters and dashes, such asour-super-cool-website.GITHUB_ORG: The GitHub organization, exactly how it is in the URL when viewing your GitHub repository.GITHUB_REPO: The GitHub repository with your code.
When all 5 bash variables are filled in (do NOT put "" around any of the values), open your Cloud Shell terminal and run the following:
./setup.shThis should output something like the following:
PROJECT_ID: 'melissakohltechx25'
SERVICE_NAME: 'my-ai-shoe-webapp'
SERVICE_REGION: 'us-central1'
SERVICE_ACCOUNT: '354393498738-compute@developer.gserviceaccount.com'
WORKLOAD_IDENTITY_PROVIDER: 'projects/354393498738/locations/global/workloadIdentityPools/github-provider/providers/github-project-repo'In step 2, the terminal output should end with a set of variables. Copy the whole block.
Open the file cloud-run.yml under the .github folder. There are 2 places with TODO in the file: follow the instructions in each TODO and paste in the output from your terminal into the file.
Make sure you have Owners permission on the GCP project in IAM.
Fill in the bash variables at the top of manual-deploy.sh, using the same values as in Step 2.
Double check that your terminal is in your team repository (the cd command from step 1). Then run the following.
./manual-deploy.shRun the following commands.
git add .``shell git commit -m "Set up GitHub Actions."
```shell
git push origin main
In GitHub, go to your repository and click on "Actions". Check that the workflows passed. Alternatively, in the main page for your repository, you should see the latest commit message at the top of the files, and either a red X or a green checkmark for the GitHub workflows.