Skip to content

Commit

Permalink
Try more complex tag checking
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Dec 6, 2024
1 parent bca3ce3 commit 44a6282
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions .github/workflows/addon-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
if: env.has_tag == 'false' || (env.has_tag == 'true' && !startsWith(github.ref, 'refs/heads/main'))
run: pnpm ember deploy production

0 comments on commit 44a6282

Please sign in to comment.