From 72967346bb6c0d0e14d56249fafa0d7a81288726 Mon Sep 17 00:00:00 2001 From: Huy Do Date: Tue, 25 Oct 2022 13:02:51 -0700 Subject: [PATCH] Only push to Docker and Anaconda repo from main --- .github/workflows/build-conda-images.yml | 2 +- .github/workflows/build-libtorch-images.yml | 2 +- .github/workflows/build-llvm-images.yml | 2 +- .github/workflows/build-magma-linux.yml | 2 +- .github/workflows/build-magma-windows.yml | 2 +- .github/workflows/build-manywheel-images.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-conda-images.yml b/.github/workflows/build-conda-images.yml index 92567d7bd..1d388c4fa 100644 --- a/.github/workflows/build-conda-images.yml +++ b/.github/workflows/build-conda-images.yml @@ -19,7 +19,7 @@ env: DOCKER_BUILDKIT: 1 DOCKER_ID: ${{ secrets.DOCKER_ID }} DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - WITH_PUSH: ${{ github.event_name == 'push' }} + WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} jobs: build-docker: diff --git a/.github/workflows/build-libtorch-images.yml b/.github/workflows/build-libtorch-images.yml index 9526434e4..f866b27ec 100644 --- a/.github/workflows/build-libtorch-images.yml +++ b/.github/workflows/build-libtorch-images.yml @@ -21,7 +21,7 @@ env: DOCKER_BUILDKIT: 1 DOCKER_ID: ${{ secrets.DOCKER_ID }} DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - WITH_PUSH: ${{ github.event_name == 'push' }} + WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} jobs: build-docker-cuda: diff --git a/.github/workflows/build-llvm-images.yml b/.github/workflows/build-llvm-images.yml index 5b24abf5f..bea07aafd 100644 --- a/.github/workflows/build-llvm-images.yml +++ b/.github/workflows/build-llvm-images.yml @@ -17,7 +17,7 @@ env: DOCKER_BUILDKIT: 1 DOCKER_ID: ${{ secrets.DOCKER_ID }} DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - WITH_PUSH: ${{ github.event_name == 'push' }} + WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} FORCE_PUSH: yes jobs: diff --git a/.github/workflows/build-magma-linux.yml b/.github/workflows/build-magma-linux.yml index 655d02c6e..939040475 100644 --- a/.github/workflows/build-magma-linux.yml +++ b/.github/workflows/build-magma-linux.yml @@ -54,7 +54,7 @@ jobs: run: | conda install -y conda-build anaconda-client - name: Push MAGMA to anaconda - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} run: | anaconda --token $ANACONDA_TOKEN upload -u pytorch --force magma/output/linux-64/magma-cuda*.bz2 env: diff --git a/.github/workflows/build-magma-windows.yml b/.github/workflows/build-magma-windows.yml index 87fdb22c5..822d3fade 100644 --- a/.github/workflows/build-magma-windows.yml +++ b/.github/workflows/build-magma-windows.yml @@ -36,7 +36,7 @@ jobs: with: path: magma_*_cuda*_*.7z push-windows-magma: - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} environment: magma runs-on: ubuntu-18.04 needs: build-windows-magma diff --git a/.github/workflows/build-manywheel-images.yml b/.github/workflows/build-manywheel-images.yml index 48a6ca60a..27f0da234 100644 --- a/.github/workflows/build-manywheel-images.yml +++ b/.github/workflows/build-manywheel-images.yml @@ -21,7 +21,7 @@ env: DOCKER_BUILDKIT: 1 DOCKER_ID: ${{ secrets.DOCKER_ID }} DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} - WITH_PUSH: ${{ github.event_name == 'push' }} + WITH_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} jobs: build-docker-cuda: