Skip to content

Commit

Permalink
chore: deploy gh pages only if build exists
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Jul 1, 2024
1 parent 71154eb commit 233f7a8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/update-admin-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,20 @@ jobs:
# Build
nix-shell -p yarn --run "yarn build"
- name: Deploy to GitHub Pages
- name: Check if build directory exists
if: env.CURRENT_HASH != env.WEEK_OLD_HASH
run: |
if [ -d "./dev.blink.sv/build" ]; then
echo "DIR_EXISTS=true" >> $GITHUB_ENV
else
echo "DIR_EXISTS=false" >> $GITHUB_ENV
fi
- name: Deploy to GitHub Pages
if: env.CURRENT_HASH != env.WEEK_OLD_HASH && env.DIR_EXISTS == 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_dir: ./dev.blink.sv/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
13 changes: 11 additions & 2 deletions .github/workflows/update-public-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,20 @@ jobs:
# Build
nix-shell -p yarn --run "yarn build"
- name: Deploy to GitHub Pages
- name: Check if build directory exists
if: env.CURRENT_HASH != env.WEEK_OLD_HASH
run: |
if [ -d "./dev.blink.sv/build" ]; then
echo "DIR_EXISTS=true" >> $GITHUB_ENV
else
echo "DIR_EXISTS=false" >> $GITHUB_ENV
fi
- name: Deploy to GitHub Pages
if: env.CURRENT_HASH != env.WEEK_OLD_HASH && env.DIR_EXISTS == 'true'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_dir: ./dev.blink.sv/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com

0 comments on commit 233f7a8

Please sign in to comment.