diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml new file mode 100644 index 000000000..a5a57816f --- /dev/null +++ b/.github/workflows/build-push.yaml @@ -0,0 +1,68 @@ +--- +name: Publish container images in quay.io + +on: + push: + branches: + - main + +jobs: + push_controller: + name: Push controller container image to quay.io + if: github.repository == 'csi-addons/kubernetes-csi-addons' + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to quay.io + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push controller container image + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7 + push: true + tags: quay.io/csi-addons/k8s-controller:latest + + push_sidecar: + name: Push sidecar container image to quay.io + if: github.repository == 'csi-addons/kubernetes-csi-addons' + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to quay.io + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push sidecar container image + uses: docker/build-push-action@v2 + with: + context: . + file: build/Containerfile.sidecar + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7 + push: true + tags: quay.io/csi-addons/k8s-sidecar:latest diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml new file mode 100644 index 000000000..de7f485c4 --- /dev/null +++ b/.github/workflows/test-build.yaml @@ -0,0 +1,52 @@ +--- +name: Test building container images + +on: + pull_request: + branches: + - "*" + +jobs: + build_controller: + name: Build controller container image + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build container container image + uses: docker/build-push-action@v2 + with: + context: . + file: Dockerfile + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7 + push: false + tags: quay.io/csi-addons/k8s-controller:latest + + build_sidecar: + name: Test sidecar container image + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build sidecar container image + uses: docker/build-push-action@v2 + with: + context: . + file: build/Containerfile.sidecar + platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/arm/v7 + push: false + tags: quay.io/csi-addons/k8s-sidecar:latest