🚧 trigger action #72
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
name: Deploy Documentation | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- docs/** | |
jobs: | |
build-and-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Cache node_modules | |
id: cache-nodemodules | |
uses: actions/cache@v3 | |
with: | |
path: docs/node_modules | |
key: ${{ runner.os }}-cache-docs-nodemodules-${{ hashFiles('docs/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-cache-docs-nodemodules- | |
- name: Install Dependencies if Cache Miss | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: | | |
cd docs | |
npm ci | |
echo "Listing node_modules as cache was not hit:" | |
ls -la node_modules | |
- name: Log node_modules Contents if Cache Hit | |
if: steps.cache-nodemodules.outputs.cache-hit == 'true' | |
run: | | |
echo "Cache was hit. Listing node_modules contents:" | |
ls -la docs/node_modules | |
echo "Checking for 'vike' package:" | |
ls -la docs/node_modules/.bin | |
npm ls vike | |
- name: Build Documentation | |
run: | | |
cd docs | |
npm run docs:publish | |
# - name: Deploy to GitHub Pages | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: ./docs/dist/client | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@4.1.4 | |
with: | |
branch: gh-pages | |
folder: docs/dist/client | |
# Remove previous build files | |
clean: true | |
# Do not remove the `.nojekyll` file: we have manually added an empty `.nojekyll` file at the root of the `gh-pages` branch and we don't want having to re-create it after each build. | |
clean-exclude: | | |
.nojekyll |