fix(ci): Support ARM builds #434
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: | |
# push: | |
# branches: [ main ] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
push: | |
branches: [main] | |
tags: | |
- v* | |
jobs: | |
build-operator: | |
runs-on: ubuntu-latest | |
env: | |
IMG: ghcr.io/dragonflydb/operator:${{ github.sha }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build and Publish image into GHCR | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
tags: | | |
ghcr.io/dragonflydb/operator:${{ github.sha }} | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
env: | |
DOCKER_BUILDKIT: 1 | |
- uses: helm/[email protected] | |
with: | |
cluster_name: kind | |
config: ./hack/kind-config.yaml | |
- name: Run tests | |
timeout-minutes: 12 | |
run: | | |
make docker-kind-load | |
make deploy | |
make test | |
- name: Cleanup | |
run: | | |
make undeploy | |
release-operator: | |
permissions: | |
contents: write | |
packages: write | |
runs-on: ubuntu-latest | |
needs: build-operator | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
env: | |
IMG: ghcr.io/dragonflydb/operator:${{ github.ref_name }} | |
VERSION: ${{ github.ref_name }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build | |
run: | | |
make build | |
- name: Login to Github container repository | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Publish image into GHCR | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/dragonflydb/operator:${{ github.ref_name }} | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
env: | |
DOCKER_BUILDKIT: 1 | |
DOCKER_USERNAME: ${{ github.actor }} | |
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
- name: publish github release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./bin/dragonfly-operator | |
LICENSE | |
name: ${{ github.ref_name }} | |
tag_name: ${{ github.ref_name }} | |
body: | | |
Release ${{ github.ref_name }} | |
Docker image: ghcr.io/dragonflydb/operator:${{ github.ref_name }} | |
draft: true |