π synced file(s) with bosch-grow-pat/onyx (#6) #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build all | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/[email protected] | |
with: | |
bazelisk-cache: true | |
disk-cache: ${{ github.workflow }} | |
repository-cache: true | |
- name: Build with Bazel | |
run: bazel build //... | |
- name: Test with Bazel | |
run: bazel test //... | |
#### | |
## only on push to main | |
#### | |
- name: Log in to the Container registry | |
if: github.event_name == 'push' | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push the core image to the OCI registry | |
if: github.event_name == 'push' | |
#run: bazel run --embed_label="${GITHUB_SHA::6}" --stamp //core-image:push-image | |
run: bazel run //core-image:push-image | |
- name: Push the chart to the OCI registry | |
if: github.event_name == 'push' | |
run: bazel run //chart:yaku_helm.push_registry |