| name: test |
| on: |
| pull_request: {} |
| |
| jobs: |
| build-prometheus-ethtool-exporter: |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v3 |
| with: |
| fetch-depth: 0 |
| - uses: tj-actions/changed-files@v36 |
| id: changed-files |
| with: |
| files: images/prometheus-ethtool-exporter/* |
| - uses: docker/setup-qemu-action@v2 |
| if: steps.changed-files.outputs.any_changed == 'true' |
| - uses: docker/setup-buildx-action@v2 |
| if: steps.changed-files.outputs.any_changed == 'true' |
| - run: echo PROJECT_REF=$(cat images/prometheus-ethtool-exporter/ref) >> $GITHUB_ENV |
| if: steps.changed-files.outputs.any_changed == 'true' |
| - uses: docker/login-action@v2 |
| if: steps.changed-files.outputs.any_changed == 'true' |
| with: |
| registry: quay.io |
| username: ${{ secrets.QUAY_USERNAME }} |
| password: ${{ secrets.QUAY_ROBOT_TOKEN }} |
| - uses: docker/build-push-action@v4 |
| if: steps.changed-files.outputs.any_changed == 'true' |
| with: |
| context: images/prometheus-ethtool-exporter |
| cache-from: type=gha,scope=prometheus-ethtool-exporter |
| cache-to: type=gha,mode=max,scope=prometheus-ethtool-exporter |
| platforms: linux/amd64,linux/arm64 |
| push: true |
| build-args: | |
| PROJECT_REF=${{ env.PROJECT_REF }} |
| tags: | |
| quay.io/vexxhost/ethtool-exporter:${{ env.PROJECT_REF }} |