name: Push Image Build
on:
  push:
    branches:
      - master
jobs:
  push-image-to-container-registry:
    if: ${{ github.event.pull_request.head.repo.full_name == 'rook/rook' }}
    runs-on: ubuntu-18.04
    steps:
      - name: checkout
        uses: actions/checkout@v2

       # docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host.
      - name: set up QEMU
        uses: docker/setup-qemu-action@master
        with:
          platforms: all

      - name: log in to container registry
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_USR }}
          aws-secret-access-key: ${{ secrets.AWS_PSW }}
          aws-region: us-east-1

      - name: unshallow
        run: git fetch --prune --unshallow --tags

      # creating custom env var
      - name: set env
        run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV

      - name: build and release
        env:
          GIT_API_TOKEN: ${{ secrets.GIT_API_TOKEN }}
          BRANCH_NAME: ${{ env.BRANCH_NAME }}
          AWS_USR: ${{ secrets.AWS_USR }}
          AWS_PSW: ${{ secrets.AWS_PSW }}
        run: tests/scripts/build-release.sh

name: Push Image Build
on:
  push:
    branches:
      - master
jobs:
  push-image-to-container-registry:
    runs-on: ubuntu-18.04
    steps:
      - name: checkout
        uses: actions/checkout@v2

       # docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host.
      - name: set up QEMU
        uses: docker/setup-qemu-action@master
        with:
          platforms: all

      - name: log in to container registry
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_USR }}
          aws-secret-access-key: ${{ secrets.AWS_PSW }}
          aws-region: us-east-1

      - name: unshallow
        run: git fetch --prune --unshallow --tags

      # creating custom env var
      - name: set env
        run: echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV

      - name: build and release
        env:
          GIT_API_TOKEN: ${{ secrets.GIT_API_TOKEN }}
          BRANCH_NAME: ${{ env.BRANCH_NAME }}
          AWS_USR: ${{ secrets.AWS_USR }}
          AWS_PSW: ${{ secrets.AWS_PSW }}
        run: tests/scripts/build-release.sh

Revert "ci: restrict push image build action to run on fork"
Revert "ci: restrict push image build action to run on fork"

This reverts commit e0206c56d5843f40d5ecae9bb75454296dd58044.

Signed-off-by: Travis Nielsen <a8b474fdb3f77f44446f0ab9ddca8147b09b3a9e@redhat.com>
