mirror of
https://github.com/JonasunderscoreJones/docs.jonasjones.dev.git
synced 2025-10-22 18:49:18 +02:00
59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
name: build-docusaurus
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: checkout repository
|
|
uses: https://code.forgejo.org/actions/checkout@v4
|
|
|
|
- name: Debug workspace
|
|
run: |
|
|
pwd
|
|
ls -la
|
|
|
|
- name: setup node
|
|
uses: https://github.com/actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: restore cached dependencies
|
|
uses: https://code.forgejo.org/actions/cache/restore@v4
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
docusaurus/node_modules
|
|
key: ${{ runner.os }}-Docusaurus
|
|
|
|
- name: install dependencies
|
|
run: npm install --frozen-lockfile
|
|
|
|
- name: build project
|
|
run: npm run build
|
|
|
|
- name: Capture entire build folder
|
|
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
|
with:
|
|
name: build-artifacts
|
|
path: build
|
|
if-no-files-found: error
|
|
|
|
- name: Debug2
|
|
run: |
|
|
echo "Listing build directory"
|
|
ls -l build
|
|
|
|
|
|
- name: cache downloaded dependencies
|
|
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
|
uses: https://code.forgejo.org/actions/cache/save@v4
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
docusaurus/node_modules
|
|
key: ${{ runner.os }}-Docusaurus
|