|
| 1 | +name: Docker publish |
| 2 | + |
| 3 | +# This workflow uses actions that are not certified by GitHub. |
| 4 | +# They are provided by a third-party and are governed by |
| 5 | +# separate terms of service, privacy policy, and support |
| 6 | +# documentation. |
| 7 | + |
| 8 | +on: |
| 9 | + |
| 10 | + push: |
| 11 | + branches: [ "main" ] |
| 12 | + # Publish semver tags as releases. |
| 13 | + tags: [ 'v*.*.*' ] |
| 14 | + pull_request: |
| 15 | + branches: [ "main" ] |
| 16 | + |
| 17 | + |
| 18 | +defaults: |
| 19 | + run: |
| 20 | + shell: 'bash -Eeuo pipefail -x {0}' |
| 21 | + |
| 22 | +jobs: |
| 23 | + generate-jobs: |
| 24 | + name: customlimitrange-manager-build |
| 25 | + runs-on: ubuntu-latest |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + include: |
| 30 | + - |
| 31 | + name: customlimitrange-manager |
| 32 | + image: dongjiang1989/customlimitrange-manager:latest |
| 33 | + file: ./hack/build/Dockerfile |
| 34 | + platforms: linux/amd64,linux/arm64 |
| 35 | + |
| 36 | + steps: |
| 37 | + - |
| 38 | + name: Checkout |
| 39 | + uses: actions/checkout@v3 |
| 40 | + - |
| 41 | + name: Set up QEMU |
| 42 | + uses: docker/setup-qemu-action@v2 |
| 43 | + - |
| 44 | + name: Set up Docker Buildx |
| 45 | + uses: docker/setup-buildx-action@v2 |
| 46 | + - |
| 47 | + name: Login to Registry |
| 48 | + uses: docker/login-action@v2 |
| 49 | + with: |
| 50 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 51 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 52 | + - |
| 53 | + name: Build and push |
| 54 | + uses: docker/build-push-action@v3 |
| 55 | + with: |
| 56 | + file: ${{ matrix.file }} |
| 57 | + platforms: ${{ matrix.platforms }} |
| 58 | + push: true |
| 59 | + tags: ${{ matrix.image }} |
| 60 | + - name: Test ${{ matrix.name }} |
| 61 | + run: | |
| 62 | + docker pull ${{ matrix.image}}:${{ matrix.name }} |
| 63 | + docker image inspect ${{ matrix.image}}:${{ matrix.name }} |
0 commit comments