Skip to content

Commit

Permalink
Update container CI (#2218)
Browse files Browse the repository at this point in the history
* Deprecate xgo binaries workflow

* Update container workflows. Enable trivy scan
  • Loading branch information
jcortejoso authored Jan 19, 2024
1 parent 3a189b0 commit 346c5b3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 125 deletions.
101 changes: 0 additions & 101 deletions .github/workflows/build-sign-binaries.yaml

This file was deleted.

23 changes: 13 additions & 10 deletions .github/workflows/build-sign-commit-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Login at GCP Artifact Registry
# v1.12.3 is main at Oct 26, 2023
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v1.12.3
# v1.14.2 is main at Oct 26, 2023
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v1.14.2
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-dev/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@v1.12.3
uses: celo-org/reusable-workflows/.github/actions/build-container@v1.14.2
with:
platforms: linux/amd64,linux/arm64
registry: us-west1-docker.pkg.dev/devopsre/dev-images/geth
tag: ${{ github.sha }}
tags: ${{ github.sha }}
context: .
dockerfile: Dockerfile
push: ${{ fromJSON(true) }}
load: ${{ fromJSON(false) }}
trivy: ${{ fromJSON(true) }}

build-container-geth-master:
runs-on: [self-hosted, blockchain, 8-cpu]
Expand All @@ -43,21 +44,22 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v1.12.3
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v1.14.2
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/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@v1.12.3
uses: celo-org/reusable-workflows/.github/actions/build-container@v1.14.2
with:
platforms: linux/amd64,linux/arm64
registry: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth
tag: master
tags: master
context: .
dockerfile: Dockerfile
push: ${{ fromJSON(true) }}
load: ${{ fromJSON(false) }}
trivy: ${{ fromJSON(true) }}

build-container-geth-all-master:
runs-on: [self-hosted, blockchain, 8-cpu]
Expand All @@ -69,18 +71,19 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Login at GCP Artifact Registry
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v1.12.3
uses: celo-org/reusable-workflows/.github/actions/auth-gcp-artifact-registry@v1.14.2
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/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@v1.12.3
uses: celo-org/reusable-workflows/.github/actions/build-container@v1.14.2
with:
platforms: linux/amd64,linux/arm64
registry: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-all
tag: master
tags: master
context: .
dockerfile: Dockerfile.alltools
push: ${{ fromJSON(true) }}
load: ${{ fromJSON(false) }}
trivy: ${{ fromJSON(true) }}
27 changes: 13 additions & 14 deletions .github/workflows/build-sign-release-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,92 +53,91 @@ jobs:
echo "MAJOR_MINOR=${semver[0]}.${semver[1]}" >> $GITHUB_OUTPUT
build-container-geth-dev:
# v1.12.3 is main at Oct 25th 2023
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.3
# v1.14.2 is main at Jan 19th 2024
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.14.2
if: startsWith(github.ref, 'refs/heads/release')
needs:
- replace-branch-name
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-dev/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/geth
tag: ${{ needs.replace-branch-name.outputs.replaced-branch }}
tags: ${{ needs.replace-branch-name.outputs.replaced-branch }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile
trivy: true


build-container-geth-all-dev:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.3
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.14.2
if: startsWith(github.ref, 'refs/heads/release')
needs:
- replace-branch-name
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain-dev/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/geth-all
tag: ${{ needs.replace-branch-name.outputs.replaced-branch }}
tags: ${{ needs.replace-branch-name.outputs.replaced-branch }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile.alltools
trivy: true

build-container-geth-devopsre:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.3
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.14.2
if: startsWith(github.ref, 'refs/tags/v') && false
needs:
- replace-tag-v
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth
tag: ${{ needs.replace-tag-v.outputs.replaced-tag }}
tags: ${{ needs.replace-tag-v.outputs.replaced-tag }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile
trivy: true

build-container-geth-all-devopsre:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.3
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.14.2
if: startsWith(github.ref, 'refs/tags/v') && false
needs:
- replace-tag-v
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-all
tag: ${{ needs.replace-tag-v.outputs.replaced-tag }}
tags: ${{ needs.replace-tag-v.outputs.replaced-tag }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile.alltools
trivy: true

build-container-geth-celo-org:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.3
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.14.2
if: startsWith(github.ref, 'refs/tags/v')
needs:
- replace-tag-v
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-docker.pkg.dev/celo-org/us.gcr.io/geth
tag: ${{ needs.replace-tag-v.outputs.replaced-tag }}
tags: ${{ needs.replace-tag-v.outputs.replaced-tag }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile
trivy: true

build-container-geth-all-celo-org:
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.12.3
uses: celo-org/reusable-workflows/.github/workflows/container-cicd.yaml@v1.14.2
if: startsWith(github.ref, 'refs/tags/v')
needs:
- replace-tag-v
with:
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
service-account: '[email protected]'
artifact-registry: us-docker.pkg.dev/celo-org/us.gcr.io/geth-all
tag: ${{ needs.replace-tag-v.outputs.replaced-tag }}
tags: ${{ needs.replace-tag-v.outputs.replaced-tag }}
platforms: linux/amd64,linux/arm64
context: .
file: Dockerfile.alltools
Expand Down

0 comments on commit 346c5b3

Please sign in to comment.