Skip to content
This repository was archived by the owner on Dec 22, 2022. It is now read-only.

Commit 4441b82

Browse files
author
Mathieu Benoit
committed
github actions setup docs
1 parent 91568c5 commit 4441b82

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

README.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# asm-workshop
22

3+
## About the content of this lab
4+
35
Put this https://alwaysupalwayson.com/asm-security as a workshop.
46

57
1. [ ] Create a GKE cluster
@@ -20,9 +22,11 @@ Further considerations:
2022
- Multi-cluster?
2123
- MCP (control/data plane)?
2224
- Integrate CRfA in there? Or do another similar crfa-workshop?
25+
- Do a Neos tutorial based on this? Qwiklabs or Codelabs?
2326

27+
## Developer setup
2428

25-
## Build and run this static web site locally
29+
### Build and run this static web site locally
2630

2731
```
2832
git clone --recurse-submodules https://github.com/mathieu-benoit/asm-workshop
@@ -31,6 +35,37 @@ docker build -t asm-workshop .
3135
docker run -d -p 8080:8080 asm-workshop
3236
```
3337

34-
## Configure GitHub action
38+
### Configure GitHub action
39+
40+
```
41+
projectId=FIXME
42+
gcloud config set project $projectId
43+
44+
# Setup Service account
45+
saName=asm-workshop-gha-cr-push
46+
saId=$saName@$projectId.iam.gserviceaccount.com
47+
gcloud iam service-accounts create $saName \
48+
--display-name=$saName
49+
gcloud iam service-accounts keys create ~/tmp/$saName.json \
50+
--iam-account $saId
51+
52+
# Setup Artifact Registry
53+
artifactRegistryName=FIXME
54+
artifactRegistryLocation=FIXME
55+
gcloud artifacts repositories add-iam-policy-binding $artifactRegistryName \
56+
--project $projectId \
57+
--location $artifactRegistryLocation \
58+
--member "serviceAccount:$saId" \
59+
--role roles/artifactregistry.writer
60+
gcloud projects add-iam-policy-binding $projectId \
61+
--member=serviceAccount:$saId \
62+
--role=roles/ondemandscanning.admin
3563
36-
FIXME
64+
# Setup GitHub actions variables
65+
gh auth login --web
66+
gh secret set CONTAINER_REGISTRY_PUSH_PRIVATE_KEY < ~/tmp/$saName.json
67+
rm ~/tmp/$saName.json
68+
gh secret set CONTAINER_REGISTRY_PROJECT_ID -b"${projectId}"
69+
gh secret set CONTAINER_REGISTRY_NAME -b"${artifactRegistryName}"
70+
gh secret set CONTAINER_REGISTRY_HOST_NAME -b"${artifactRegistryLocation}-docker.pkg.dev"
71+
```

0 commit comments

Comments
 (0)