From 99e41eb8ab7228608d00a0ed98fb90631cc6f212 Mon Sep 17 00:00:00 2001 From: Jane Chu <7559015+janechu@users.noreply.github.com> Date: Mon, 18 Apr 2022 17:27:36 -0700 Subject: [PATCH] Added files to trigger the GitHub pages workflow (#213) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request ## 📖 Description This change adds the docs folder files to the gitignore, except the README for ease of local development. It also adds a GitHub workflow to trigger against `main` branch merges (and manual triggers) that will release of the documentation site. This should be merged after #212 ## ✅ Checklist ### General - [ ] I have added tests for my changes. - [x] I have tested my changes. - [x] I have updated the project documentation to reflect my changes. --- .github/workflows/cd-gh-pages.yml | 52 +++++++++++++++++++++++++++++++ .gitignore | 6 ++++ docs/README.md | 3 ++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/cd-gh-pages.yml create mode 100644 docs/README.md diff --git a/.github/workflows/cd-gh-pages.yml b/.github/workflows/cd-gh-pages.yml new file mode 100644 index 0000000..9aab30b --- /dev/null +++ b/.github/workflows/cd-gh-pages.yml @@ -0,0 +1,52 @@ +name: Deploy GitHub Pages + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node: [16.x] + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Cache multiple paths + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + 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: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + + - name: Install Dependencies + run: npm ci + + - name: Build + run: npm run build --if-present + + - name: Build GitHub Pages + run: npm run build:gh-pages -w website + + - name: Deploy GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4.3.0 + with: + branch: gh-pages # The branch the action should deploy to. + folder: docs # The folder the action should deploy. + diff --git a/.gitignore b/.gitignore index baf58bd..bdf0d91 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,9 @@ temp/ # Ignore Build Artefacts bin/ obj/ + +# Ignore the docs folder +docs/* + +# Except the docs folder README +!docs/README.md \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..5c1fce9 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,3 @@ +# Description + +This folder contains the statically generated documentation site, intended for use by GitHub pages. Aside from this README.md file, all files in this folder are automatically generated by files in the website/ folder. \ No newline at end of file