Skip to content

init failling docker image #1

init failling docker image

init failling docker image #1

name: CD / Job Agent / Kubernetes Job
on:
pull_request:
branches: ["*"]
paths:
- job-agent/kubernetes-job/**
- .github/workflows/job-agent-kubernetes-job.yaml
- pnpm-lock.yaml
push:
branches: ["main"]
paths:
- job-agent/kubernetes-job/**
- .github/workflows/job-agent-kubernetes-job.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/job-agent/kubernetes-job
tags: |
type=sha,format=short,prefix=
- name: Build
uses: docker/build-push-action@v6
if: github.ref != 'refs/heads/main'
with:
push: false
file: job-agent/kubernetes-job/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: job-agent/kubernetes-job/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/job-agent/kubernetes-job
# tags: |
# type=sha,format=short,prefix=
# - id: "deploy"
# uses: "google-github-actions/deploy-cloudrun@v2"
# with:
# service: "docs"
# image: ${{ steps.meta.outputs.tags }}