Skip to content

Build Docusaurus site #802

Build Docusaurus site

Build Docusaurus site #802

Workflow file for this run

name: Build Docusaurus site
on:
push:
branches:
- master
pull_request: {}
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: npm ci
- name: Generate API reference
run: npm run generate
- name: Build
run: npm run build
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: build
path: build
retention-days: 1
include-hidden-files: 'true'
# Deployment job
deploy:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "deploy"
cancel-in-progress: false
environment:
name: production
url: https://developer.mittwald.de
if: success() && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: build
path: build
- name: Deploy to mittwald space
uses: burnett01/[email protected]
with:
switches: -avzr --delete
path: build/
remote_path: /html/developer-portal-cutl1
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}