Skip to content

fix build context

fix build context #6

name: Build and Publish Relay Images (CUDA & Standard)
on:
push:
branches:
- main
- helm
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [standard, cuda]
permissions:
contents: read
packages: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Version from Cargo.toml
run: echo "VERSION=${{ github.head_ref || github.ref_name }}-$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" >> $GITHUB_ENV
working-directory: ./relay
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/bonsol-relay:${{ matrix.flavor }}-${{ env.VERSION }}
ghcr.io/${{ github.repository_owner }}/bonsol-relay:${{ matrix.flavor }}-latest
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
FLAVOR=${{ matrix.flavor }}