From 44a6282d6dfc17505f3e306193452c73c89f1b4f Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Thu, 5 Dec 2024 20:34:02 -0500 Subject: [PATCH] Try more complex tag checking --- .github/workflows/addon-docs.yml | 38 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/workflows/addon-docs.yml b/.github/workflows/addon-docs.yml index dad7b276..6b0b8086 100644 --- a/.github/workflows/addon-docs.yml +++ b/.github/workflows/addon-docs.yml @@ -12,7 +12,6 @@ jobs: env: DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} runs-on: ubuntu-latest - if: "!startsWith(github.ref, 'refs/tags/')" steps: - uses: actions/checkout@v4 with: @@ -26,28 +25,19 @@ jobs: cache: pnpm - name: Install Dependencies run: pnpm install --no-lockfile - - name: Deploy Docs + - name: Check for tags + id: check-tags run: | - pnpm ember deploy production - - tag-build: - env: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: pnpm/action-setup@v4 - with: - version: 9 - - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: pnpm - - name: Install Dependencies - run: pnpm install --no-lockfile + # Get tags pointing to the current commit + TAGS=$(git tag --points-at $GITHUB_SHA) + echo "Tags found: $TAGS" + + # Save whether tags exist as an output variable + if [ -z "$TAGS" ]; then + echo "has_tag=false" >> $GITHUB_ENV + else + echo "has_tag=true" >> $GITHUB_ENV + fi - name: Deploy Docs - run: | - pnpm ember deploy production \ No newline at end of file + if: env.has_tag == 'false' || (env.has_tag == 'true' && !startsWith(github.ref, 'refs/heads/main')) + run: pnpm ember deploy production \ No newline at end of file