-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create gh-pages deploy actions (#18)
* Create gh-pages-main.yml * Add pr-preview.yml * Add ghpages scripts * Slight fix to ghpages scripts * Add vite config * Update gitignore * Formatting * Empty commit to trigger actions
- Loading branch information
Showing
6 changed files
with
861 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,39 @@ | ||
# This workflow will generate the static page under `main` subdirectory inside the `gh-pages` branch | ||
|
||
# This workflow will run every time new changes were pushed to the `main` branch | ||
|
||
name: App build CI/CD to main branch | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Create build files for gh-pages deploy | ||
run: yarn ghpages:build | ||
|
||
# Reference: https://github.com/JamesIves/github-pages-deploy-action | ||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4.3.3 | ||
with: | ||
branch: gh-pages | ||
folder: ghpages | ||
clean-exclude: pr/ | ||
force: false | ||
target-folder: main | ||
token: ${{ secrets.GH_TOKEN }} |
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,37 @@ | ||
# This workflow will generate the static page under `pr` subdirectory inside the `gh-pages` branch | ||
|
||
# This workflow will run every time there's a PR opened, reopened, synchronize, or closed | ||
|
||
name: Deploy PR previews | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
|
||
concurrency: preview-${{ github.ref }} | ||
|
||
jobs: | ||
deploy-preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Install and Build | ||
run: | | ||
yarn install | ||
yarn ghpages:build | ||
# Reference: https://github.com/rossjrw/pr-preview-action | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./ghpages/ | ||
umbrella-dir: pr |
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 |
---|---|---|
|
@@ -18,4 +18,9 @@ | |
# build | ||
/_site/ | ||
/dist/ | ||
/out-tsc/ | ||
/out-tsc/ | ||
/build/ | ||
ghpages | ||
dist | ||
dist-ssr | ||
*.local |
Oops, something went wrong.