Skip to content

Commit 54d76c0

Browse files
committed
Deploy to VPS (api.jellyrock.app) instead of GitHub Pages
Replaces the GitHub Pages publish step with an rsync to the VPS path served by Caddy at api.jellyrock.app. The build pipeline (update.yml running JSDoc on repository_dispatch from jellyrock/jellyrock) is unchanged — this only changes where the generated docs end up. Uses the same hardened SSH approach as the homepage and docs workflows: DEPLOY_SSH_KEY + pre-verified VPS_KNOWN_HOSTS, printf for the key, StrictHostKeyChecking=yes, contents:read job permissions.
1 parent f2bca3e commit 54d76c0

2 files changed

Lines changed: 32 additions & 32 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# Simple workflow for deploying static content to GitHub Pages
2-
name: gh-pages
1+
name: Deploy API Docs
32

43
on:
54
push:
6-
branches:
7-
- main
5+
branches: [main]
86
paths-ignore:
97
- '.github/workflows/build.yml'
108
- '.github/workflows/update.yml'
@@ -13,38 +11,40 @@ on:
1311
- 'LICENSE'
1412
- 'README.md'
1513
- 'renovate.json'
16-
17-
# Allows you to run this workflow manually from the Actions tab
1814
workflow_dispatch:
1915

20-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
concurrency:
17+
group: deploy-api-docs
18+
cancel-in-progress: true
19+
2120
permissions:
2221
contents: read
23-
pages: write
24-
id-token: write
25-
26-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
27-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
28-
concurrency:
29-
group: "pages"
30-
cancel-in-progress: false
3122

3223
jobs:
33-
run:
34-
environment:
35-
name: github-pages
36-
url: ${{ steps.deployment.outputs.page_url }}
24+
deploy:
3725
runs-on: ubuntu-latest
3826
steps:
3927
- name: Checkout
40-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
41-
- name: Setup Pages
42-
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
43-
- name: Upload artifact
44-
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
45-
with:
46-
# Only upload the code docs folder
47-
path: "docs"
48-
- name: Deploy to GitHub Pages
49-
id: deployment
50-
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5
28+
uses: actions/checkout@v4
29+
30+
- name: Set up SSH
31+
env:
32+
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
33+
VPS_KNOWN_HOSTS: ${{ secrets.VPS_KNOWN_HOSTS }}
34+
run: |
35+
mkdir -p ~/.ssh
36+
chmod 700 ~/.ssh
37+
printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
38+
chmod 600 ~/.ssh/id_ed25519
39+
printf '%s\n' "$VPS_KNOWN_HOSTS" > ~/.ssh/known_hosts
40+
chmod 644 ~/.ssh/known_hosts
41+
42+
- name: Deploy docs/ to VPS via rsync
43+
env:
44+
VPS_HOST: ${{ secrets.VPS_HOST }}
45+
VPS_USER: ${{ secrets.VPS_USER }}
46+
run: |
47+
rsync -avz --delete \
48+
-e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes" \
49+
docs/ \
50+
"${VPS_USER}@${VPS_HOST}:/opt/jellyrock/api-docs/"

jsdoc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"theme_opts": {
2424
"default_theme": "fallback-dark",
25-
"base_url": "https://jellyrock.github.io/api-docs/",
25+
"base_url": "https://api.jellyrock.app/",
2626
"title": "JellyRock Code Documentation",
2727
"homepageTitle": "JellyRock Code Documentation",
2828
"displayModuleHeader": true,
@@ -49,7 +49,7 @@
4949
"id": "jellyfin-link"
5050
}
5151
],
52-
"footer": "<span class=\"jsdoc-message\">Automatically generated using <a href=\"https://github.com/jsdoc/jsdoc\" target=\"_blank\">JSDoc</a> and the <a href=\"https://github.com/ankitskvmdam/clean-jsdoc-theme\" target=\"_blank\">clean-jsdoc-theme</a>.</span>"
52+
"footer": "<span class=\"jsdoc-message\">Automatically generated using <a href=\"https://github.com/jsdoc/jsdoc\" target=\"_blank\">JSDoc</a> and the <a href=\"https://github.com/ankitskvmdam/clean-jsdoc-theme\" target=\"_blank\">clean-jsdoc-theme</a>.</span><script defer src=\"https://analytics.jellyrock.app/script.js\" data-website-id=\"07139597-641c-42e6-8f5a-cbb0d9182a20\"></script>"
5353
}
5454
},
5555
"markdown": {

0 commit comments

Comments
 (0)