Skip to content

Commit

Permalink
Use matrix to run separate builds for each arch
Browse files Browse the repository at this point in the history
  • Loading branch information
znerol committed Jan 6, 2024
1 parent 9c37fc2 commit 9460ca6
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ on:
- 'setup.py'

jobs:
deploy:
test:
strategy:
matrix:
include:
- platform: 'linux/arm64'
tag: prometheus-pve-exporter:develop-arm64
smoketest: false
- platform: 'linux/amd64'
tag: prometheus-pve-exporter:develop-amd64
smoketest: true

runs-on: ubuntu-latest

permissions:
Expand All @@ -31,13 +41,14 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
- name: Build Docker image (all architectures)
uses: docker/build-push-action@v5
with:
context: .
load: true
platforms: linux/arm64,linux/amd64
tags: prometheus-pve-exporter:develop
platforms: ${{ matrix.platform }}
tags: ${{ matrix.tag }}

- name: Container image smoketest
run: docker run --rm prometheus-pve-exporter:develop --help
if: ${{ matrix.smoketest }}
run: docker run --rm ${{ matrix.tag }} --help

0 comments on commit 9460ca6

Please sign in to comment.