Fix: detect when hardware platform is aarch64 #776
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 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
jobs: | |
get-changed-files: | |
name: Get Changed Files | |
runs-on: ubuntu-20.04 | |
outputs: | |
changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} | |
control-plane-changed: ${{ steps.control-plane-changed.outputs.any_modified }} | |
dataplane-changed: ${{ steps.dataplane-changed.outputs.any_modified }} | |
workflow-changed: ${{ steps.workflow-changed.outputs.any_modified }} | |
steps: | |
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 | |
with: | |
fetch-depth: 0 | |
- name: Get list of all changes | |
uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f | |
id: changed-files | |
- name: Check if any files related to the building of the control plane image have changed (see the Dockerfiles) | |
uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f | |
id: control-plane-changed | |
with: | |
files: | | |
Containerfile.controlplane | |
go.mod | |
go.sum | |
main.go | |
controllers/ | |
LICENSE | |
- name: Check if any files related to the building of the dataplane image have changed (see the Dockerfiles) | |
uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f | |
id: dataplane-changed | |
with: | |
files: | | |
Containerfile.dataplane | |
dataplane/go.mod | |
dataplane/go.sum | |
dataplane/main.go | |
dataplane/xdp.c | |
dataplane/LICENCE | |
- name: Check if any of the workflow files have changed | |
uses: tj-actions/changed-files@716b1e13042866565e00e85fd4ec490e186c4a2f | |
id: workflow-changed | |
with: | |
files: | | |
.github/workflows/ | |
- name: List all changed files | |
run: | | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo "$file" | |
done | |
pr-docker-build: | |
name: PR Docker build | |
needs: [ get-changed-files ] | |
if: >- | |
github.event_name == 'pull_request' | |
&& ( | |
needs.get-changed-files.outputs.control-plane-changed == 'true' | |
|| needs.get-changed-files.outputs.dataplane-changed == 'true' | |
|| needs.get-changed-files.outputs.workflow-changed == 'true' | |
) | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c74574e6c82eeedc46366be1b0d287eff9085eb6 | |
with: | |
install: true | |
- name: Docker build - Control Plane | |
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 | |
with: | |
context: . | |
file: Containerfile.controlplane | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: kubernetes-sigs/blixt-controlplane:pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }} | |
outputs: type=docker,dest=/tmp/blixt-controlplane.tar | |
- name: Upload Image Artifact - Control Plane | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 | |
with: | |
name: blixt-controlplane | |
path: /tmp/blixt-controlplane.tar | |
- name: Docker build - Dataplane | |
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 | |
with: | |
context: . | |
file: Containerfile.dataplane | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: kubernetes-sigs/blixt-dataplane:pr-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }} | |
outputs: type=docker,dest=/tmp/blixt-dataplane.tar | |
- name: Upload Image Artifact - Dataplane | |
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 | |
with: | |
name: blixt-dataplane | |
path: /tmp/blixt-dataplane.tar | |
main-docker-build: | |
name: Main branch Docker build | |
needs: [ get-changed-files ] | |
if: >- | |
github.event_name == 'push' | |
&& ( | |
needs.get-changed-files.outputs.control-plane-changed == 'true' | |
|| needs.get-changed-files.outputs.dataplane-changed == 'true' | |
|| needs.get-changed-files.outputs.workflow-changed == 'true' | |
) | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c74574e6c82eeedc46366be1b0d287eff9085eb6 | |
with: | |
install: true | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker build - Control Plane | |
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 | |
with: | |
context: . | |
file: Containerfile.controlplane | |
push: false # TODO: https://github.com/kubernetes-sigs/blixt/issues/106 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ghcr.io/kubernetes-sigs/blixt-controlplane:latest | |
- name: Docker build - Data Plane | |
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 | |
with: | |
context: . | |
file: Containerfile.dataplane | |
push: false # TODO: https://github.com/kubernetes-sigs/blixt/issues/106 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: ghcr.io/kubernetes-sigs/blixt-dataplane:latest |