Skip to content

Add trust proxy setting in backend/index.ts #4

Add trust proxy setting in backend/index.ts

Add trust proxy setting in backend/index.ts #4

name: Build and Push to GCR
on:
push:
branches:
- main
paths:
- "backend/**"
env:
REGION: europe-west2
PROJECT: dojodraw
REPO: dojodraw-backend
IMAGE: dojodraw-backend
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up variables
run: echo "IMAGE_TAG=$REGION-docker.pkg.dev/$PROJECT/$REPO/$IMAGE" >> $GITHUB_ENV
- name: Google Cloud Auth
uses: google-github-actions/auth@v1
with:
credentials_json: "${{ secrets.GC_IMAGE_MANAGER_KEY }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Docker auth
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ${{ env.IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max