blob: 708ac9cb11a43dd1039d23e4d4a081c024a42102 [file] [log] [blame]
Mohammed Nasera4e52902022-08-30 00:20:05 -04001name: test
2on:
3 pull_request: {}
Mohammed Nasera4e52902022-08-30 00:20:05 -04004
5jobs:
Mohammed Naser9a5ff202022-09-07 15:56:48 -04006 build-prometheus-ethtool-exporter:
Mohammed Naserd4e634d2022-08-30 18:46:03 -04007 runs-on: ubuntu-latest
Mohammed Naserd4e634d2022-08-30 18:46:03 -04008 steps:
Mohammed Naser88cb2762023-01-18 03:28:21 +00009 - uses: actions/checkout@v3
Mohammed Naser09d8ea82022-09-03 19:16:18 -040010 with:
Mohammed Naser9a5ff202022-09-07 15:56:48 -040011 fetch-depth: 0
dependabot[bot]351916c2023-05-30 15:24:05 -040012 - uses: tj-actions/changed-files@v36
Mohammed Naser9a5ff202022-09-07 15:56:48 -040013 id: changed-files
14 with:
15 files: images/prometheus-ethtool-exporter/*
Mohammed Naser88cb2762023-01-18 03:28:21 +000016 - uses: docker/setup-qemu-action@v2
Mohammed Naser9a5ff202022-09-07 15:56:48 -040017 if: steps.changed-files.outputs.any_changed == 'true'
Mohammed Naser88cb2762023-01-18 03:28:21 +000018 - uses: docker/setup-buildx-action@v2
Mohammed Naser9a5ff202022-09-07 15:56:48 -040019 if: steps.changed-files.outputs.any_changed == 'true'
20 - run: echo PROJECT_REF=$(cat images/prometheus-ethtool-exporter/ref) >> $GITHUB_ENV
21 if: steps.changed-files.outputs.any_changed == 'true'
Mohammed Naser88cb2762023-01-18 03:28:21 +000022 - uses: docker/login-action@v2
Mohammed Naser9a5ff202022-09-07 15:56:48 -040023 if: steps.changed-files.outputs.any_changed == 'true'
24 with:
25 registry: quay.io
26 username: ${{ secrets.QUAY_USERNAME }}
27 password: ${{ secrets.QUAY_ROBOT_TOKEN }}
dependabot[bot]3c5f12d2023-02-03 04:26:05 +000028 - uses: docker/build-push-action@v4
Mohammed Naser9a5ff202022-09-07 15:56:48 -040029 if: steps.changed-files.outputs.any_changed == 'true'
30 with:
31 context: images/prometheus-ethtool-exporter
32 cache-from: type=gha,scope=prometheus-ethtool-exporter
33 cache-to: type=gha,mode=max,scope=prometheus-ethtool-exporter
34 platforms: linux/amd64,linux/arm64
35 push: true
36 build-args: |
37 PROJECT_REF=${{ env.PROJECT_REF }}
38 tags: |
39 quay.io/vexxhost/ethtool-exporter:${{ env.PROJECT_REF }}