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
1 parent
ea51c9b
commit e0eb856
Showing
1 changed file
with
69 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,69 @@ | ||
name: Deploy Web | ||
on: | ||
push: | ||
branches: [main] | ||
env: | ||
BEFORE_SHA: ${{ github.event.before }} | ||
cache-name: npm | ||
|
||
defaults: | ||
run: | ||
working-directory: ./website | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Fetch repository | ||
run: git fetch origin main | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Summarize install | ||
run: echo '### Dependencies Installed! :heavy_check_mark:' >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Generate dynamic pages | ||
run: npm run generate-dynamic-pages | ||
|
||
- name: Build docs | ||
run: npm run build | ||
|
||
- name: Summarize build | ||
run: echo '### Website Built! :heavy_check_mark:' >> $GITHUB_STEP_SUMMARY | ||
|
||
- name: Turn off History Expansion | ||
run: set +H | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@4.1.6 | ||
with: | ||
branch: gh-pages | ||
folder: build/ | ||
|
||
- name: Summarize deploy | ||
run: echo '### Deployed to Pages! :rocket:' >> $GITHUB_STEP_SUMMARY |