create bucket, setup cors, check the bucket's cors:
gcloud storage buckets create gs://zinovik-gallery --location=europe-central2
gcloud storage buckets update gs://zinovik-gallery --cors-file=cors_file.json
gcloud storage buckets describe gs://zinovik-gallery --format="default(cors_config)"
gcloud storage buckets update gs://zinovik-gallery --versioning
gcloud iam service-accounts create github-actions
add roles (Service Account User
and Cloud Functions Admin
) to the service account you want to use to deploy the function
gcloud projects add-iam-policy-binding zinovik-project --member="serviceAccount:[email protected]" --role="roles/cloudfunctions.admin"
gcloud projects add-iam-policy-binding zinovik-project --member="serviceAccount:[email protected]" --role="roles/iam.serviceAccountUser"
creating keys for service account for github-actions GOOGLE_CLOUD_SERVICE_ACCOUNT_KEY_FILE
gcloud iam service-accounts keys create key-file.json [email protected]
cat key-file.json | base64
gcloud projects add-iam-policy-binding zinovik-project --member="serviceAccount:[email protected]" --role="roles/secretmanager.secretAccessor"
printf "CLOUDINARY_CREDENTIALS" | gcloud secrets create media-urls-updater-cloudinary-credentials --locations=europe-central2 --replication-policy="user-managed" --data-file=-