12
12
env :
13
13
DEPLOY_KEY : ${{ secrets.DEPLOY_KEY }}
14
14
runs-on : ubuntu-latest
15
- if : " !startsWith(github.ref, 'refs/tags/')"
16
15
steps :
17
16
- uses : actions/checkout@v4
18
17
with :
@@ -26,28 +25,19 @@ jobs:
26
25
cache : pnpm
27
26
- name : Install Dependencies
28
27
run : pnpm install --no-lockfile
29
- - name : Deploy Docs
28
+ - name : Check for tags
29
+ id : check-tags
30
30
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
51
41
- 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