Merge pull request #348 from ceph/dependabot/go_modules/k8s-dependenc… #180
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-and-push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release-* | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'ceph/ceph-csi-operator' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | |
| - name: Login to Quay.io | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_IO_USERNAME }} | |
| password: ${{ secrets.QUAY_IO_PASSWORD }} | |
| - name: Set up Image tag | |
| run: | | |
| echo "image tag ${{ github.ref }}" | |
| if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| echo "IMAGE_TAG=latest" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref }}" == refs/heads/* ]]; then | |
| TAG=$(echo ${{ github.ref }} | sed 's/refs\/heads\///') | |
| echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV | |
| elif [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///') | |
| echo "IMAGE_TAG=${TAG}" >> $GITHUB_ENV | |
| fi | |
| - name: Build and push Docker images | |
| run: make docker-buildx IMAGE_TAG=${{ env.IMAGE_TAG }} |