Skip to content

fix: Init target variable ui #375

fix: Init target variable ui

fix: Init target variable ui #375

Workflow file for this run

name: Apps / Docs
on:
pull_request:
branches: ["*"]
paths:
- apps/docs/**
- packages/ui/**
- .github/workflows/apps-docs.yaml
- pnpm-lock.yaml
push:
branches: ["main"]
paths:
- apps/docs/**
- packages/ui/**
- .github/workflows/apps-docs.yaml
- pnpm-lock.yaml
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: "google-github-actions/auth@v2"
id: auth
with:
token_format: access_token
project_id: ctrlplane-prod
service_account: [email protected]
workload_identity_provider: "projects/591038869087/locations/global/workloadIdentityPools/github/providers/github"
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: "Docker auth"
run: |-
gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: us-central1-docker.pkg.dev/ctrlplane-prod/apps/docs
tags: |
type=sha,format=short,prefix=
- name: Build
uses: docker/build-push-action@v6
if: github.ref != 'refs/heads/main'
with:
push: false
file: apps/docs/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
- name: Build and Push
uses: docker/build-push-action@v6
if: github.ref == 'refs/heads/main'
with:
push: true
file: apps/docs/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: "google-github-actions/auth@v2"
id: auth
with:
token_format: access_token
project_id: ctrlplane-prod
service_account: "[email protected]"
workload_identity_provider: "projects/591038869087/locations/global/workloadIdentityPools/github/providers/github"
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: us-central1-docker.pkg.dev/ctrlplane-prod/apps/docs
tags: |
type=sha,format=short,prefix=
- id: "deploy"
uses: "google-github-actions/deploy-cloudrun@v2"
with:
service: "docs"
image: ${{ steps.meta.outputs.tags }}