mirror of
https://github.com/JonasunderscoreJones/docs.jonasjones.dev.git
synced 2025-10-22 18:49:18 +02:00
added auto-build workflow files
This commit is contained in:
parent
a4489e0389
commit
efe610fcd0
2 changed files with 89 additions and 0 deletions
50
.forgejo/workflows/build-docusaurus.yml
Normal file
50
.forgejo/workflows/build-docusaurus.yml
Normal file
|
@ -0,0 +1,50 @@
|
|||
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: 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
|
||||
working-directory: docusaurus
|
||||
|
||||
- name: build project
|
||||
run: npm run build
|
||||
working-directory: docusaurus
|
||||
|
||||
- name: capture build artifacts
|
||||
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: docusaurus-artifacts.zip
|
||||
path: docusaurus/build/
|
||||
if-no-files-found: error
|
||||
|
||||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue