-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (74 loc) · 2.58 KB
/
ci-cd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
name: CI/CD for socket-exporter
on:
push:
branches:
- "main"
release:
types: [published]
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' && ! startsWith(github.ref, 'refs/tags/') }}
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
tags: 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
tags: 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/')
with:
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-socket-exporter-tag/providers/github-by-repos
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/socket-exporter/socket-exporter
tags: ${{ github.ref_name }}
context: .
file: ./Dockerfile
trivy: true