-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (43 loc) · 1.35 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
---
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
container-build-and-push-sha:
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
security-events: write
steps:
- uses: actions/checkout@v4
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@main
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-socket-exporter-main/providers/github-by-repos'
service-account: '[email protected]'
docker-gcp-registries: us-west1-docker.pkg.dev
- name: Build and push container
uses: celo-org/reusable-workflows/.github/actions/build-container@main
with:
platforms: linux/amd64,linux/arm64
registry: us-west1-docker.pkg.dev/devopsre/socket-exporter/socket-exporter
tag: ${{ github.sha }}
context: .
dockerfile: ./Dockerfile
push: ${{ fromJSON(true) }}
load: ${{ fromJSON(false) }}