blob: 1d5bde08f55f23492b27425db3875510df5c08ca [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 Naserbd5667e2022-09-01 17:38:14 -04006 build-prometheus-ethtool-exporter:
7 runs-on: ubuntu-latest
8 steps:
9 - uses: actions/checkout@v3.0.2
10 with:
11 fetch-depth: 0
dependabot[bot]15743e02022-09-05 13:28:24 +000012 - uses: tj-actions/changed-files@v29.0.3
Mohammed Naserbd5667e2022-09-01 17:38:14 -040013 id: changed-files
14 with:
15 files: images/prometheus-ethtool-exporter/*
16 - uses: docker/setup-qemu-action@v2.0.0
17 if: steps.changed-files.outputs.any_changed == 'true'
18 - uses: docker/setup-buildx-action@v2.0.0
19 if: steps.changed-files.outputs.any_changed == 'true'
Mohammed Naser50dc73d2022-09-01 17:42:48 -040020 - run: echo PROJECT_REF=$(cat images/prometheus-ethtool-exporter/ref) >> $GITHUB_ENV
21 if: steps.changed-files.outputs.any_changed == 'true'
Mohammed Naserbd5667e2022-09-01 17:38:14 -040022 - uses: docker/login-action@v2.0.0
23 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 }}
28 - uses: docker/build-push-action@v3.1.1
29 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: |
Mohammed Naser50dc73d2022-09-01 17:42:48 -040037 PROJECT_REF=${{ env.PROJECT_REF }}
Mohammed Naserbd5667e2022-09-01 17:38:14 -040038 tags: |
Mohammed Naser50dc73d2022-09-01 17:42:48 -040039 quay.io/vexxhost/ethtool-exporter:${{ env.PROJECT_REF }}
Mohammed Naserbd5667e2022-09-01 17:38:14 -040040
Mohammed Nasera4e52902022-08-30 00:20:05 -040041 # TODO(mnaser): Molecule