Skip to content

Commit

Permalink
Uses the keep_files flag to ensure that the main merge does not clobb…
Browse files Browse the repository at this point in the history
…er the previews
  • Loading branch information
elijahbenizzy committed Sep 25, 2024
1 parent 8fd57de commit 9a978ae
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ jobs:
number: ${{ github.event.number }}
id: deploy-preview
message: "Starting deployment of preview ⏳..."
- name: Deploy to GitHub Pages
- name: Build PR preview website
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: github.ref != 'refs/heads/main'
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
# force_orphan: true # TODO -- determine whether this is the right approach
- name: Build PR preview website
destination_dir: ${{ env.PR_PATH }} # TODO you need to set this if you're using a custom domain. Otherwise you can remove it.
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref != 'refs/heads/main'
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
destination_dir: ${{ env.PR_PATH }} # TODO you need to set this if you're using a custom domain. Otherwise you can remove it.
keep_files: true # Add this line to keep existing files in the gh-pages branch
- name: Update comment
uses: hasura/[email protected]
if: github.ref != 'refs/heads/main'
Expand Down

0 comments on commit 9a978ae

Please sign in to comment.