-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 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,56 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Checkout src repo | ||
with: | ||
path: src | ||
fetch-depth: 0 | ||
ref: main | ||
submodules: recursive | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' # Or your desired version | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
working-directory: src | ||
|
||
- name: Build | ||
run: npm run build | ||
working-directory: src | ||
|
||
# Checkout destination repository | ||
- name: Checkout dest repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: dest | ||
fetch-depth: 0 | ||
ref: gh-pages | ||
|
||
# Copy the built website files | ||
- name: Copy website built from src/docs folder | ||
working-directory: dest | ||
run: | | ||
rm -rf * | ||
yes | cp -rf ../src/docs/* . # Replace '(output_folder)' with your build output dir | ||
# Commit and push changes | ||
- name: Commit website updates | ||
working-directory: dest | ||
run: | | ||
git config --global user.name github-actions | ||
git config --global user.email [email protected] | ||
git add . | ||
git diff-index --quiet HEAD || git commit -m "Deploy website updates with GitHub Actions: ${GITHUB_SHA}" | ||
git push origin gh-pages |