2023-07-02 16:31:04 -04:00
|
|
|
# SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
name: Deploy HD2 docs to Netlify
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ develop ]
|
|
|
|
paths: ['docs/**']
|
|
|
|
|
|
|
|
env:
|
|
|
|
NETLIFY_VERSION: 13.2.2
|
|
|
|
NODEJS_VERSION: 20
|
|
|
|
PYTHON_VERSION: 3.11
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: docs
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Deploys to netlify
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-08-28 18:27:28 -04:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2023-07-02 16:31:04 -04:00
|
|
|
|
2023-10-08 11:16:24 -04:00
|
|
|
- name: Set up NodeJS
|
2024-09-26 12:46:52 -04:00
|
|
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
2023-07-02 16:31:04 -04:00
|
|
|
with:
|
2023-10-08 11:16:24 -04:00
|
|
|
node-version: ${{ env.NODEJS_VERSION }}
|
2023-07-02 16:31:04 -04:00
|
|
|
|
|
|
|
- name: Set up Python
|
2024-02-10 10:36:26 -05:00
|
|
|
uses: actions/setup-python@v5
|
2023-07-02 16:31:04 -04:00
|
|
|
with:
|
|
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip install -r requirements.txt
|
|
|
|
|
|
|
|
- name: Build docs
|
|
|
|
run: mkdocs build
|
|
|
|
|
|
|
|
- name: Run netlify CLI deployment
|
|
|
|
env:
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
2023-10-08 11:38:00 -04:00
|
|
|
run: "npx -y netlify-cli@${{ env.NETLIFY_VERSION }} deploy --build --prod --message \"${{ github.event.head_commit.id }}\""
|