From f6df1f9755346a5d55024fcdb532e584b0b2cc1d Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Tue, 26 Mar 2024 07:07:27 -0700 Subject: [PATCH] Update workflows to use correct environments (#1088) * Add debug steps Signed-off-by: Aaron Crawfis * Update env name logic Signed-off-by: Aaron Crawfis --------- Signed-off-by: Aaron Crawfis --- .github/workflows/website.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index d016b4715..e44841216 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -22,7 +22,8 @@ jobs: if: github.event.action != 'closed' runs-on: ubuntu-latest environment: - name: ${{ github.ref_name == 'edge' && 'edge' || 'latest' }} + # If a PR into edge, use 'edge'. If a PR into anywhere else, use 'latest'. If a push, use the branch name. + name: ${{ github.event_name == 'pull_request' && (github.base_ref == 'edge' && 'edge' || 'latest') || github.ref_name }} env: GOVER: '^1.17' TUTORIAL_PATH: './docs/content/user-guides/tutorials/' @@ -87,6 +88,7 @@ jobs: needs: ['build'] runs-on: ubuntu-latest environment: + # If push to edge, use 'edge'. If push to anywhere else, use 'latest'. name: ${{ github.ref_name == 'edge' && 'edge' || 'latest' }} url: ${{ github.ref_name == 'edge' && 'https://edge.docs.radapp.io' || 'https://docs.radapp.io' }} steps: @@ -117,8 +119,10 @@ jobs: needs: ['build'] runs-on: ubuntu-latest environment: - name: ${{ github.ref_name == 'edge' && 'edge' || 'latest' }} - url: ${{ github.ref_name == 'edge' && 'https://edge.docs.radapp.io' || 'https://docs.radapp.io' }} + # If a PR into edge, use 'edge'. If a PR into anywhere else, use 'latest'. If a push, use the branch name. + name: ${{ github.event_name == 'pull_request' && (github.base_ref == 'edge' && 'edge' || 'latest') || github.ref_name }} + # If a push to edge, use the edge URL. If a push to anywhere else, use the latest URL. If a PR, blank. + url: ${{ github.event_name == 'pull_request' && '' || (github.ref_name == 'edge' && 'https://edge.docs.radapp.io' || 'https://docs.radapp.io') }} steps: - name: Download Hugo artifacts uses: actions/download-artifact@v3 @@ -142,8 +146,9 @@ jobs: if: github.event_name == 'pull_request' && github.event.action == 'closed' runs-on: ubuntu-latest environment: - name: ${{ github.ref_name == 'edge' && 'edge' || 'latest' }} - url: ${{ github.ref_name == 'edge' && 'https://edge.docs.radapp.io' || 'https://docs.radapp.io' }} + # If a PR into edge, use 'edge'. If a PR into anywhere else, use 'latest'. + name: ${{ github.base_ref == 'edge' && 'edge' || 'latest' }} + url: ${{ github.base_ref == 'edge' && 'https://edge.docs.radapp.io' || 'https://docs.radapp.io' }} steps: - name: Close Pull Request id: closepullrequest @@ -159,6 +164,7 @@ jobs: needs: ['build', 'deploy'] runs-on: ubuntu-latest environment: + # If push to edge, use 'edge'. If push to anywhere else, use 'latest'. name: ${{ github.ref_name == 'edge' && 'edge' || 'latest' }} env: ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_API_APPID }}