Skip to content

CI/CD options

CI/CD options #4

Workflow file for this run

---
name: CI/CD for socket-exporter
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the project
run: |
make build
socket-exporter-build-dev:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/socket-exporter
needs: build
permissions:
contents: read
id-token: write
security-events: write
if: |
github.ref != 'refs/heads/main'
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-socket-exporter/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/socket-exporter
tag: test
context: .
file: ./Dockerfile
trivy: true
socket-exporter-build-main:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/socket-exporter/socket-exporter
needs: build
permissions:
contents: read
id-token: write
security-events: write
if: |
github.ref == 'refs/heads/main'
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-socket-exporter-main/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/socket-exporter/socket-exporter
tag: latest
context: .
file: ./Dockerfile
trivy: true
socket-exporter-build-tag:
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
name: Build us-west1-docker.pkg.dev/devopsre/socket-exporter/socket-exporter tag
needs: build
permissions:
contents: read
id-token: write
security-events: write
if: |
startsWith(github.ref, 'refs/tags/socket-exporter-')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-socket-exporter/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/socket-exporter/socket-exporter
tag: ${{ github.ref_name }}
context: .
file: ./Dockerfile
trivy: true