Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 1 | name: test |
| 2 | on: |
| 3 | pull_request: {} |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 4 | |
| 5 | jobs: |
Mohammed Naser | bd5667e | 2022-09-01 17:38:14 -0400 | [diff] [blame] | 6 | 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] | 15743e0 | 2022-09-05 13:28:24 +0000 | [diff] [blame] | 12 | - uses: tj-actions/changed-files@v29.0.3 |
Mohammed Naser | bd5667e | 2022-09-01 17:38:14 -0400 | [diff] [blame] | 13 | 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 Naser | 50dc73d | 2022-09-01 17:42:48 -0400 | [diff] [blame] | 20 | - run: echo PROJECT_REF=$(cat images/prometheus-ethtool-exporter/ref) >> $GITHUB_ENV |
| 21 | if: steps.changed-files.outputs.any_changed == 'true' |
Mohammed Naser | bd5667e | 2022-09-01 17:38:14 -0400 | [diff] [blame] | 22 | - 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 Naser | 50dc73d | 2022-09-01 17:42:48 -0400 | [diff] [blame] | 37 | PROJECT_REF=${{ env.PROJECT_REF }} |
Mohammed Naser | bd5667e | 2022-09-01 17:38:14 -0400 | [diff] [blame] | 38 | tags: | |
Mohammed Naser | 50dc73d | 2022-09-01 17:42:48 -0400 | [diff] [blame] | 39 | quay.io/vexxhost/ethtool-exporter:${{ env.PROJECT_REF }} |
Mohammed Naser | bd5667e | 2022-09-01 17:38:14 -0400 | [diff] [blame] | 40 | |
Mohammed Naser | a4e5290 | 2022-08-30 00:20:05 -0400 | [diff] [blame] | 41 | # TODO(mnaser): Molecule |