-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add addon-docs deploy action (#1713)
- Loading branch information
1 parent
41cfd5c
commit 8f0dc77
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Publish Addon Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- "**" | ||
jobs: | ||
build: | ||
env: | ||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check for tags and set short-circuit condition | ||
id: check-tags | ||
run: | | ||
# Fetch tags pointing to the current commit | ||
TAGS=$(git tag --points-at $GITHUB_SHA) | ||
echo "Tags found: $TAGS" | ||
# Check if a tag exists and if the ref is 'refs/heads/main' or 'refs/heads/master' | ||
if [ -n "$TAGS" ] && ([[ "${GITHUB_REF}" == "refs/heads/main" ]] || [[ "${GITHUB_REF}" == "refs/heads/master" ]]); then | ||
echo "SHORT_CIRCUIT=true" >> $GITHUB_ENV | ||
else | ||
echo "SHORT_CIRCUIT=false" >> $GITHUB_ENV | ||
fi | ||
- uses: pnpm/action-setup@v4 | ||
if: env.SHORT_CIRCUIT == 'false' | ||
with: | ||
version: 9 | ||
- uses: actions/setup-node@v4 | ||
if: env.SHORT_CIRCUIT == 'false' | ||
with: | ||
node-version: 18 | ||
cache: pnpm | ||
- name: Install Dependencies | ||
if: env.SHORT_CIRCUIT == 'false' | ||
run: pnpm install --no-lockfile | ||
- name: Deploy Docs | ||
if: env.SHORT_CIRCUIT == 'false' | ||
run: | | ||
cd test-app | ||
pnpm ember deploy production |