fix(ci): quota_project pro gcloud builds submit #8
@ -37,18 +37,20 @@ jobs:
|
|||||||
project_id: ${{ secrets.GCP_PROJECT }}
|
project_id: ${{ secrets.GCP_PROJECT }}
|
||||||
|
|
||||||
- name: Build & push (Cloud Build, sem Docker local)
|
- name: Build & push (Cloud Build, sem Docker local)
|
||||||
env:
|
|
||||||
# SA key auth não popula quota_project no credentials file → gcloud
|
|
||||||
# cai em "default" e a chamada à Service Usage API falha com
|
|
||||||
# "serviceusage.services.use forbidden" mesmo com a role concedida.
|
|
||||||
CLOUDSDK_BILLING_QUOTA_PROJECT: ${{ secrets.GCP_PROJECT }}
|
|
||||||
run: |
|
run: |
|
||||||
IMG="${IMAGE_BASE}/${{ gitea.event.repository.name }}:lab-${{ gitea.run_number }}"
|
IMG="${IMAGE_BASE}/${{ gitea.event.repository.name }}:lab-${{ gitea.run_number }}"
|
||||||
gcloud config set billing/quota_project "${{ secrets.GCP_PROJECT }}"
|
# --gcs-source-staging-dir: pula auto-detect que precisa de
|
||||||
|
# storage.buckets.list (project-scope) — gitea-cd só tem grant
|
||||||
|
# na bucket _cloudbuild, não no projeto inteiro.
|
||||||
|
# --suppress-logs: gcloud streama logs do Cloud Build pra stdout e
|
||||||
|
# isso exige Viewer/Owner no projeto. SA não tem; suprimir os
|
||||||
|
# logs ainda espera o build terminar e propaga o exit code.
|
||||||
gcloud builds submit \
|
gcloud builds submit \
|
||||||
--tag "$IMG" \
|
--tag "$IMG" \
|
||||||
--project=${{ secrets.GCP_PROJECT }} \
|
--project=${{ secrets.GCP_PROJECT }} \
|
||||||
--timeout=30m
|
--timeout=30m \
|
||||||
|
--gcs-source-staging-dir="gs://${{ secrets.GCP_PROJECT }}_cloudbuild/source" \
|
||||||
|
--suppress-logs
|
||||||
echo "IMG=$IMG" >> $GITHUB_ENV
|
echo "IMG=$IMG" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Deploy hml2 (apenas em push pra master/main)
|
- name: Deploy hml2 (apenas em push pra master/main)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user