-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.19 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
71 lines (62 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy docs
# Unversioned /layers FTP. `docs` label = deploy on merge without waiting for a package release.
on:
workflow_dispatch:
release:
types: [published]
pull_request:
types: [closed]
branches: [main]
permissions:
contents: read
# Single FTP root — don't overlap uploads.
concurrency:
group: deploy-docs-production
cancel-in-progress: false
jobs:
deploy:
name: 🚀 Build & Deploy docs (FTP)
if: >
github.event_name == 'workflow_dispatch' ||
github.event_name == 'release' ||
(github.event_name == 'pull_request' &&
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'docs'))
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
# Closed PR checkout defaults to a dead merge ref — pin the merge commit on main.
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.merge_commit_sha || github.sha }}
# Sitemap lastmod uses `git log` per file.
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup
# Islands resolve workspace package `dist/` — same order as CI docs job.
- name: Build packages
run: bun run build
- name: Generate API reference (Markdown)
run: bun run docs:api
- name: Build docs site
env:
# Changelog github-releases source + avoid unauthenticated API rate limits.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run docs:build
# FTP account root is already /layers — server-dir ./ is correct (not ./layers/).
- name: Upload to /layers via FTP
uses: SamKirkland/FTP-Deploy-Action@v4.4.0
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
protocol: ftps
port: 21
security: strict
local-dir: ./apps/docs/dist/
server-dir: ./
exclude: |
**/.git*
**/.git*/**
**/node_modules/**