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 | 9a5ff20 | 2022-09-07 15:56:48 -0400 | [diff] [blame] | 6 | build-prometheus-ethtool-exporter: |
Mohammed Naser | d4e634d | 2022-08-30 18:46:03 -0400 | [diff] [blame] | 7 | runs-on: ubuntu-latest |
Mohammed Naser | d4e634d | 2022-08-30 18:46:03 -0400 | [diff] [blame] | 8 | steps: |
Mohammed Naser | f3a14a3 | 2022-09-19 15:15:39 -0400 | [diff] [blame] | 9 | - uses: actions/checkout@v3.0.2 |
Mohammed Naser | 09d8ea8 | 2022-09-03 19:16:18 -0400 | [diff] [blame] | 10 | with: |
Mohammed Naser | 9a5ff20 | 2022-09-07 15:56:48 -0400 | [diff] [blame] | 11 | fetch-depth: 0 |
dependabot[bot] | 51ce45d | 2022-09-14 03:43:31 +0000 | [diff] [blame] | 12 | - uses: tj-actions/changed-files@v29.0.7 |
Mohammed Naser | 9a5ff20 | 2022-09-07 15:56:48 -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' |
| 20 | - run: echo PROJECT_REF=$(cat images/prometheus-ethtool-exporter/ref) >> $GITHUB_ENV |
| 21 | if: steps.changed-files.outputs.any_changed == 'true' |
| 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: | |
| 37 | PROJECT_REF=${{ env.PROJECT_REF }} |
| 38 | tags: | |
| 39 | quay.io/vexxhost/ethtool-exporter:${{ env.PROJECT_REF }} |