Skip to content

Commit

Permalink
Add github workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Christos Katsakioris <[email protected]>
  • Loading branch information
ckatsak committed Mar 14, 2024
1 parent 0ad4482 commit c2e3d1a
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/ghcr.io.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build & push

on:
push:
tags:
- v*
branches:
- main
workflow_dispatch:


env:
# Uses docker.io if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_PREFIX: ${{ github.repository }}


jobs:
build-and-push:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
bench:
- helloworld
- chameleon
- cnn_serving
- image_processing
- json_serdes
- lr_serving
- lr_training
- matmul
- pyaes
- rnn_serving
- video_processing

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up buildx
uses: docker/setup-buildx-action@v3

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract repository metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-${{ matrix.bench }}
labels: |
maintainer=${{ github.repository_owner }}
org.opencontainers.image.title=${{ env.IMAGE_PREFIX }}-${{ matrix.bench }}
org.opencontainers.image.description=AERO port of FunctionBench "${{ matrix.bench }}".
org.opencontainers.image.source=${{ github.repositoryUrl }}
org.opencontainers.image.licenses=Apache-2.0
flavor: latest=false
tags: |
type=semver,priority=900,prefix=,suffix=,pattern={{version}},value=
type=edge,priority=700,prefix=,suffix=,branch=$repo.default_branch
type=sha,priority=100,prefix={{branch}}-
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: Hard link server.py
run: ln server.py benches/${{ matrix.bench }}/

- name: Build and push image
uses: docker/build-push-action@v5
with:
file: benches/${{ matrix.bench }}/Dockerfile
context: benches/${{ matrix.bench }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
platforms: |
linux/amd64
linux/arm64/v8
pull: true
push: true
#cache-from: type=gha
#cache-to: type=gha,mode=max
no-cache: true

0 comments on commit c2e3d1a

Please sign in to comment.