mirror of
https://github.com/immich-app/immich.git
synced 2025-12-09 17:23:13 +03:00
94 lines
2.6 KiB
YAML
94 lines
2.6 KiB
YAML
name: Docs build
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
release:
|
|
types: [published]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
pre-job:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
should_run: ${{ steps.check.outputs.should_run }}
|
|
steps:
|
|
- id: token
|
|
uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0
|
|
with:
|
|
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }}
|
|
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
|
|
|
|
- name: Check what should run
|
|
id: check
|
|
uses: immich-app/devtools/actions/pre-job@08bac802a312fc89808e0dd589271ca0974087b5 # pre-job-action-v2.0.0
|
|
with:
|
|
github-token: ${{ steps.token.outputs.token }}
|
|
filters: |
|
|
docs:
|
|
- 'docs/**'
|
|
open-api:
|
|
- 'open-api/immich-openapi-specs.json'
|
|
force-filters: |
|
|
- '.github/workflows/docs-build.yml'
|
|
force-events: 'release'
|
|
force-branches: 'main'
|
|
|
|
build:
|
|
name: Docs Build
|
|
needs: pre-job
|
|
permissions:
|
|
contents: read
|
|
if: ${{ fromJSON(needs.pre-job.outputs.should_run).docs == true }}
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./docs
|
|
|
|
steps:
|
|
- id: token
|
|
uses: immich-app/devtools/actions/create-workflow-token@da177fa133657503ddb7503f8ba53dccefec5da1 # create-workflow-token-action-v1.0.0
|
|
with:
|
|
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }}
|
|
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
with:
|
|
persist-credentials: false
|
|
token: ${{ steps.token.outputs.token }}
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
with:
|
|
node-version-file: './docs/.nvmrc'
|
|
cache: 'pnpm'
|
|
cache-dependency-path: '**/pnpm-lock.yaml'
|
|
|
|
- name: Run install
|
|
run: pnpm install
|
|
|
|
- name: Check formatting
|
|
run: pnpm format
|
|
|
|
- name: Run build
|
|
run: pnpm build
|
|
|
|
- name: Upload build output
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
|
with:
|
|
name: docs-build-output
|
|
path: docs/build/
|
|
include-hidden-files: true
|
|
retention-days: 1
|