fix docker push #2
Workflow file for this run
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: Publish Docker image | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| push: | |
| name: Push Image | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'csi-addons/volume-replication-operator' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: ["1.17"] | |
| steps: | |
| - uses: actions/setup-go@v2 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set env | |
| # github tag will be like refs/tags/v0.1.0 :10 removes the first 10 characters | |
| run: echo RELEASE_VERSION=$(echo ${GITHUB_REF:10}) >> $GITHUB_ENV | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/[email protected] | |
| - name: Login to Quay | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_PASSWORD }} | |
| - name: copy volume-replication-operator repo in go src | |
| run: | | |
| mkdir -p /home/runner/go/src/github.com/csi-addons | |
| cp -r /home/runner/work/volume-replication-operator/volume-replication-operator /home/runner/go/src/github.com/csi-addons | |
| - name: run dockerx-build-and-push-multi-arch | |
| working-directory: "/home/runner/go/src/github.com/csi-addons/volume-replication-operator" | |
| env: | |
| GOPATH: /home/runner/go | |
| run: | | |
| export PATH=$PATH:$GOPATH/bin | |
| export VERSION="2.3.2" | |
| wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v"$VERSION"/kubebuilder_"$VERSION"_linux_amd64.tar.gz | |
| tar -zxvf kubebuilder_"$VERSION"_linux_amd64.tar.gz | |
| export KUBEBUILDER_ASSETS="$(pwd)/kubebuilder_"$VERSION"_linux_amd64/bin" | |
| # build and push image with released tag | |
| IMG_TAG="${{ env.RELEASE_VERSION }}" make dockerx-build-and-push-multi-arch |