Skip to content

Commit

Permalink
[aarch64 support] splitting docker and helm build, splitting docker b…
Browse files Browse the repository at this point in the history
…uild for different platforms
  • Loading branch information
ktatarnikov committed Jan 2, 2025
1 parent c01d504 commit c4dd3c4
Showing 1 changed file with 61 additions and 21 deletions.
82 changes: 61 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
RUST_LOG: debug
run: cargo test --all-features

build:
name: Build
build-helm-chart:
name: Build Helm Chart
runs-on: ubuntu-latest
needs: [test]

Expand All @@ -64,11 +64,68 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v3

- name: Make versions
run: |
cd "${{ github.workspace }}"
chmod +x ./version.sh
./version.sh "${{ github.sha }}" "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
echo "VERSION_APP=$(cat "./VERSION")" >> $GITHUB_ENV
echo "DOCKER_IMAGES=$(cat "./DOCKER_IMAGES")" >> $GITHUB_ENV
echo "DOCKER_TAGS=$(cat "./VERSION_DOCKER")" >> $GITHUB_ENV
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Create a github release
if: ${{ github.ref == 'refs/heads/main' }}
run: gh release create "${{ env.VERSION_APP }}"
env:
GH_TOKEN: ${{ github.token }}

- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ github.token }}
charts_dir: "./charts"
target_dir: "./helm-charts" # todo dev / release

build-docker:
name: Docker Build / ${{ matrix.platform }}
runs-on: ubuntu-latest
needs: [test]

strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
# isPR:
# - ${{github.event_name == 'pull_request'}}
# exclude:
# - { isPR: true }
# include:
# - { platform: "linux/amd64" }

defaults:
run:
working-directory: ./
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# @TODO: don't build form arm during development cos it's super slow
with:
platforms: linux/amd64, linux/arm64
platforms: ${{ matrix.platform }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -101,23 +158,6 @@ jobs:
with:
push: true
# @TODO: don't build form arm during development cos it's super slow
platforms: linux/amd64,linux/arm64
platforms: ${{ matrix.platform }}
tags: ${{ env.DOCKER_IMAGES }}
labels: ${{ steps.meta.outputs.labels }}

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Create a github release
run: gh release create "${{ env.VERSION_APP }}"
env:
GH_TOKEN: ${{ github.token }}

- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ github.token }}
charts_dir: "./charts"
target_dir: "./helm-charts"

0 comments on commit c4dd3c4

Please sign in to comment.