diff --git a/.forgejo/workflows/build-docusaurus.yml b/.forgejo/workflows/build-docusaurus.yml new file mode 100644 index 0000000..407605c --- /dev/null +++ b/.forgejo/workflows/build-docusaurus.yml @@ -0,0 +1,48 @@ +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 + + - name: build project + run: npm run build + + - name: capture build artifacts + uses: https://code.forgejo.org/forgejo/upload-artifact@v4 + with: + name: docusaurus-build-artifacts.zip + path: 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 diff --git a/.github/workflows/build-docusaurus.yml b/.github/workflows/build-docusaurus.yml new file mode 100644 index 0000000..f69dc3a --- /dev/null +++ b/.github/workflows/build-docusaurus.yml @@ -0,0 +1,45 @@ +name: build-sveltekit + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Restore npm cache + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install dependencies + run: npm install --frozen-lockfile + + - name: Build Docusaurus site + run: npm run build + + - name: capture build artifacts + uses: actions/upload-artifact@v4 + with: + name: docusaurus-build-artifacts + path: build + + - name: Save npm cache + if: ${{ github.ref_name == github.event.repository.default_branch }} + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}