From 151bab91efcee12ad14665ba135e5dc1544df659 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 21 Apr 2021 22:16:25 -0400 Subject: [PATCH] IC:2021-04-20, Add context check to docs deploy step Checks for the github context so the workflow only runs the deploy step when it runs on a push event to the main branch --- .github/workflows/build-documentation.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 84d619e07..6f7f6d9cb 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -127,12 +127,12 @@ jobs: fi - name: PDF generation installs - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} run: | sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra - name: PDF generation - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} run: | set -x mkdir deploy @@ -143,7 +143,7 @@ jobs: # pandoc CFE_Users_Guide.pdf -t gfm - name: Deploy - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -210,12 +210,12 @@ jobs: fi - name: PDF generation installs - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} run: | sudo apt-get install texlive-latex-base texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra - name: PDF generation - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} run: | mkdir deploy cd ./build/doc/osalguide/latex @@ -225,7 +225,7 @@ jobs: # pandoc CFE_Users_Guide.pdf -t gfm - name: Deploy - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && contains(github.ref, 'main')}} uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}