CI #7
Workflow file for this run
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: CI | |
on: | |
release: | |
types: [created, edited] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
DOCKERHUB_BASE: docker.io/zephyrprojectrtos | |
GHCR_BASE: ghcr.io/zephyrproject-rtos | |
BASE_IMAGE_NAME: ci-base | |
CI_IMAGE_NAME: ci | |
DEVELOPER_IMAGE_NAME: zephyr-build | |
permissions: | |
checks: write | |
contents: write | |
pull-requests: read | |
id-token: write | |
jobs: | |
build: | |
name: Build (${{ matrix.variant.platform }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
variant: | |
- platform: linux/amd64 | |
arch: amd64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
workload_identity_provider: "projects/725459261197/locations/global/workloadIdentityPools/github-actions/providers/github-actions" | |
service_account: "github-actions@playerdata-infrastructure-prod.iam.gserviceaccount.com" | |
token_format: 'access_token' | |
create_credentials_file: false | |
- name: Login to GAR | |
uses: docker/login-action@v3 | |
with: | |
registry: europe-west2-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
driver: docker | |
- name: Setup Cloud SDK | |
uses: 'google-github-actions/setup-gcloud@v2' | |
- name: Authorize Docker | |
run: | | |
gcloud auth configure-docker -q | |
- name: Extract tag name | |
id: extract_tag | |
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | |
- name: Build base image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: false | |
build-args: | | |
GOOGLE_CREDS=${{ steps.credentials_file_name.outputs.credentials_file_name }} | |
tags: | | |
europe-west2-docker.pkg.dev/playerdata-infrastructure-prod/docker-images/zephyr/ci-base:${{ steps.extract_tag.outputs.tag }} | |
- name: Build and push ci image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
build-args: | | |
BASE_IMAGE=europe-west2-docker.pkg.dev/playerdata-infrastructure-prod/docker-images/zephyr/ci-base:${{ steps.extract_tag.outputs.tag }} | |
tags: | | |
europe-west2-docker.pkg.dev/playerdata-infrastructure-prod/docker-images/zephyr/ci:${{ steps.extract_tag.outputs.tag }} | |