-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Examples fixes and preview.astro.new support (#12543)
Co-authored-by: Emanuele Stoppa <[email protected]>
- Loading branch information
Showing
6 changed files
with
48 additions
and
35 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,22 @@ | ||
# This workflow runs when changes to examples are pushed to main. | ||
# It calls a build hook on Netlify that will redeploy preview.astro.new with the latest changes. | ||
|
||
name: Redeploy preview.astro.new | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'examples/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Send a POST request to Netlify to rebuild preview.astro.new | ||
run: 'curl -X POST -d {} ${{ env.BUILD_HOOK }}' | ||
env: | ||
BUILD_HOOK: ${{ secrets.NETLIFY_PREVIEWS_BUILD_HOOK }} |
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
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
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
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
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,4 @@ | ||
const base = import.meta.env.BASE_URL.replace(/\/$/, ''); | ||
|
||
/** Prefix a URL path with the site’s base path if set. */ | ||
export const withBase = (path: string) => base + path; |