Skip to content

Commit

Permalink
giving ar.writer permissions to gh sa
Browse files Browse the repository at this point in the history
  • Loading branch information
CupOfGeo committed Jan 10, 2024
1 parent 1beaf71 commit a3bbd8b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cloudrun-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ jobs:
- name: Build and Push Backend
run: |-
cd backend/
docker build --target prod -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/attractors-backend:latest" ./
docker build --target BUILD -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/attractors-backend:latest" ./
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/attractors-backend:latest"
- name: Build and Push Frontend
run: |-
cd frontend/
docker build --target prod -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/attractors-frontend:latest" ./
docker build --target BUILD -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/attractors-frontend:latest" ./
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO }}/attractors-frontend:latest"
# END - Docker auth and build
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### PROD ###
FROM python:3.11-slim-buster as prod
### BUILD ###
FROM python:3.11-slim-buster as BUILD
RUN apt-get update
# Set the working directory to /app
WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### PROD ###
FROM python:3.11-slim-buster as prod
### BUILD ###
FROM python:3.11-slim-buster as BUILD
RUN apt-get update
# Set the working directory to /app
WORKDIR /app
Expand Down
6 changes: 6 additions & 0 deletions terraform/gh-id-federation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ resource "google_service_account" "sa" {
account_id = "gh-federation-sa"
}

resource "google_project_iam_member" "artifact_registry_writer" {
project = var.project_id
role = "roles/artifactregistry.writer"
member = "serviceAccount:${google_service_account.sa.email}"
}

resource "google_project_iam_member" "project" {
project = var.project_id
role = "roles/storage.admin"
Expand Down

0 comments on commit a3bbd8b

Please sign in to comment.