mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
dcfe722f5c
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.0.0 to 6.1.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/2028fbc5c25fe9cf00d9f06a71cc4710d4507903...395ad3262231945c25e8478fd5baf05154b1d79f) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
96 lines
3.1 KiB
YAML
96 lines
3.1 KiB
YAML
---
|
|
name: CI - API Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- next
|
|
- version-*
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- version-*
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
command:
|
|
- prettier-check
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
- name: Install Dependencies
|
|
working-directory: website/
|
|
run: npm ci
|
|
- name: Lint
|
|
working-directory: website/
|
|
run: npm run ${{ matrix.command }}
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v5
|
|
with:
|
|
node-version-file: website/package.json
|
|
cache: "npm"
|
|
cache-dependency-path: website/package-lock.json
|
|
- working-directory: website/
|
|
name: Install Dependencies
|
|
run: npm ci
|
|
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
|
|
with:
|
|
path: |
|
|
${{ github.workspace }}/website/api/.docusaurus
|
|
${{ github.workspace }}/website/api/**/.cache
|
|
key: |
|
|
${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-docusaurus-${{ hashFiles('**/package-lock.json') }}
|
|
- name: Build API Docs via Docusaurus
|
|
working-directory: website
|
|
env:
|
|
NODE_ENV: production
|
|
run: npm run build -w api
|
|
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v4
|
|
with:
|
|
name: api-docs
|
|
path: website/api/build
|
|
retention-days: 7
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- lint
|
|
- build
|
|
steps:
|
|
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v5
|
|
with:
|
|
name: api-docs
|
|
path: website/api/build
|
|
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v5
|
|
with:
|
|
node-version-file: website/package.json
|
|
cache: "npm"
|
|
cache-dependency-path: website/package-lock.json
|
|
- name: Deploy Netlify (Production)
|
|
working-directory: website/api
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
env:
|
|
NETLIFY_SITE_ID: authentik-api-docs.netlify.app
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
run: npx netlify deploy --no-build --prod
|
|
- name: Deploy Netlify (Preview)
|
|
if: github.event_name == 'pull_request' || github.ref != 'refs/heads/main'
|
|
working-directory: website/api
|
|
env:
|
|
NETLIFY_SITE_ID: authentik-api-docs.netlify.app
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
run: |
|
|
if [ -n "${VAR}" ]; then
|
|
npx netlify deploy --no-build --alias=deploy-preview-${{ github.event.number }}
|
|
fi
|