Skip to content

Commit 44a6282

Browse files
Try more complex tag checking
1 parent bca3ce3 commit 44a6282

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

.github/workflows/addon-docs.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
env:
1313
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
1414
runs-on: ubuntu-latest
15-
if: "!startsWith(github.ref, 'refs/tags/')"
1615
steps:
1716
- uses: actions/checkout@v4
1817
with:
@@ -26,28 +25,19 @@ jobs:
2625
cache: pnpm
2726
- name: Install Dependencies
2827
run: pnpm install --no-lockfile
29-
- name: Deploy Docs
28+
- name: Check for tags
29+
id: check-tags
3030
run: |
31-
pnpm ember deploy production
32-
33-
tag-build:
34-
env:
35-
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
36-
runs-on: ubuntu-latest
37-
if: startsWith(github.ref, 'refs/tags/')
38-
steps:
39-
- uses: actions/checkout@v4
40-
with:
41-
token: ${{ secrets.GITHUB_TOKEN }}
42-
- uses: pnpm/action-setup@v4
43-
with:
44-
version: 9
45-
- uses: actions/setup-node@v4
46-
with:
47-
node-version: 18
48-
cache: pnpm
49-
- name: Install Dependencies
50-
run: pnpm install --no-lockfile
31+
# Get tags pointing to the current commit
32+
TAGS=$(git tag --points-at $GITHUB_SHA)
33+
echo "Tags found: $TAGS"
34+
35+
# Save whether tags exist as an output variable
36+
if [ -z "$TAGS" ]; then
37+
echo "has_tag=false" >> $GITHUB_ENV
38+
else
39+
echo "has_tag=true" >> $GITHUB_ENV
40+
fi
5141
- name: Deploy Docs
52-
run: |
53-
pnpm ember deploy production
42+
if: env.has_tag == 'false' || (env.has_tag == 'true' && !startsWith(github.ref, 'refs/heads/main'))
43+
run: pnpm ember deploy production

0 commit comments

Comments
 (0)