Skip to content

Commit 2118bce

Browse files
Update deploying.md
1 parent 6037f9e commit 2118bce

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/dummy/app/templates/docs/deploying.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,19 @@ jobs:
110110
steps:
111111
- uses: actions/checkout@v4
112112
with:
113+
fetch-depth: 0
113114
token: ${{ secrets.GITHUB_TOKEN }}
115+
- name: Check for tags and conditionally exit
116+
run: |
117+
# Fetch tags pointing to the current commit
118+
TAGS=$(git tag --points-at $GITHUB_SHA)
119+
echo "Tags found: $TAGS"
120+
121+
# Check if a tag exists and if the ref is 'refs/heads/main' or 'refs/heads/master'
122+
if [ -n "$TAGS" ] && ([[ "${GITHUB_REF}" == "refs/heads/main" ]] || [[ "${GITHUB_REF}" == "refs/heads/master" ]]); then
123+
echo "Commit has a tag and is pushed to the main or master branch. Exiting."
124+
exit 0
125+
fi
114126
- uses: pnpm/action-setup@v4
115127
with:
116128
version: 9
@@ -121,12 +133,10 @@ jobs:
121133
- name: Install Dependencies
122134
run: pnpm install --no-lockfile
123135
- name: Deploy Docs
124-
run: |
125-
cd test-app
126-
pnpm ember deploy production
136+
run: pnpm ember deploy production
127137
```
128138
129-
This assumes you have a v2 addon and your addon docs are in the `test-app` folder, but if your addon docs are in a different location, you can change `test-app` to whatever that folder is and `cd` into it.
139+
If you are using something other than `main` or `master` for your primary branch, you will need to update the script accordingly. Also, if you have a v2 addon or a setup where your AddonDocs are in a different folder, you may need to add a `cd` into that directory in the `Deploy Docs` step.
130140

131141
## Customizing deploys
132142

0 commit comments

Comments
 (0)