|
| 1 | +# This is a GitHub workflow defining a set of jobs with a set of steps. |
| 2 | +# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions |
| 3 | +# |
| 4 | +# This test is meant to verify that our Dockerfile can build successfully when |
| 5 | +# changed on the CPU architectures we have made it support being built on. |
| 6 | +# |
| 7 | +name: Build ibm-powervs-block-csi-driver-centos-base |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + paths: |
| 12 | + - "build/base/Dockerfile" |
| 13 | + - ".github/workflows/docker-build.yml" |
| 14 | + |
| 15 | +jobs: |
| 16 | + docker: |
| 17 | + name: Build ibm-powervs-block-csi-driver-centos-base |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + packages: write |
| 22 | + steps: |
| 23 | + - name: Checkout sources |
| 24 | + uses: actions/checkout@v2 |
| 25 | + |
| 26 | + # Action reference: https://github.com/docker/setup-qemu-action |
| 27 | + - name: Set up QEMU (for docker buildx) |
| 28 | + uses: docker/setup-qemu-action@v1 |
| 29 | + |
| 30 | + # Action reference: https://github.com/docker/setup-buildx-action |
| 31 | + - name: Set up Docker Buildx |
| 32 | + uses: docker/setup-buildx-action@v1 |
| 33 | + |
| 34 | + # Action reference: https://github.com/docker/login-action |
| 35 | + - name: Login to GitHub Container Registry |
| 36 | + uses: docker/login-action@v1 |
| 37 | + with: |
| 38 | + registry: ghcr.io |
| 39 | + username: ${{ github.repository_owner }} |
| 40 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + |
| 42 | + # Convert repository owner name into lowercase letters |
| 43 | + # Action reference: https://github.com/ASzc/change-string-case-action |
| 44 | + - id: repository_owner |
| 45 | + name: lower case repository owner name |
| 46 | + uses: ASzc/change-string-case-action@v1 |
| 47 | + with: |
| 48 | + string: ${{ github.repository_owner }} |
| 49 | + |
| 50 | + # Action reference: https://github.com/docker/build-push-action |
| 51 | + - name: Build container |
| 52 | + uses: docker/build-push-action@v2 |
| 53 | + with: |
| 54 | + context: ./build/base |
| 55 | + platforms: linux/amd64,linux/ppc64le |
| 56 | + target: centos-base |
| 57 | + push: true |
| 58 | + tags: ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/ibm-powervs-block-csi-driver-centos-base:v8.0.0 |
0 commit comments