Skip to content

Commit 07fbcdf

Browse files
docs: 📚 Autobuild Documentation
1 parent e4b2dc4 commit 07fbcdf

File tree

4 files changed

+244
-17
lines changed

4 files changed

+244
-17
lines changed

.github/workflows/docs-build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Docs build
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
release:
8+
types: [published]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
pre-job:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
should_run: ${{ steps.found_paths.outputs.docs == 'true' || steps.should_force.outputs.should_force == 'true' }}
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
- id: found_paths
23+
uses: dorny/paths-filter@v3
24+
with:
25+
filters: |
26+
docs:
27+
- 'docs/**'
28+
- name: Check if we should force jobs to run
29+
id: should_force
30+
run: echo "should_force=${{ github.event_name == 'release' || github.ref_name == 'master' }}" >> "$GITHUB_OUTPUT"
31+
32+
build:
33+
name: Docs Build
34+
needs: pre-job
35+
if: ${{ needs.pre-job.outputs.should_run == 'true' }}
36+
runs-on: ubuntu-latest
37+
defaults:
38+
run:
39+
working-directory: ./docs
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: Setup Node
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version-file: "./docs/.nvmrc"
49+
50+
- name: Run npm install
51+
run: npm ci
52+
53+
- name: Check formatting
54+
run: npm run format
55+
56+
- name: Run build
57+
run: npm run build
58+
59+
- name: Upload build output
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: docs-build-output
63+
path: docs/build/
64+
retention-days: 1

.github/workflows/docs-deploy.yml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Docs deploy
2+
on:
3+
workflow_run:
4+
workflows: ["Docs build"]
5+
types:
6+
- completed
7+
8+
jobs:
9+
checks:
10+
name: Docs Deploy Checks
11+
runs-on: ubuntu-latest
12+
outputs:
13+
parameters: ${{ steps.parameters.outputs.result }}
14+
artifact: ${{ steps.get-artifact.outputs.result }}
15+
steps:
16+
- if: ${{ github.event.workflow_run.conclusion != 'success' }}
17+
run: echo 'The triggering workflow did not succeed' && exit 1
18+
- name: Get artifact
19+
id: get-artifact
20+
uses: actions/github-script@v7
21+
with:
22+
script: |
23+
// List all artifacts for the workflow run
24+
const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
run_id: context.payload.workflow_run.id,
28+
});
29+
30+
// Find the artifact named "docs-build-output"
31+
const matchArtifact = artifacts.find(artifact => artifact.name === "docs-build-output");
32+
33+
if (!matchArtifact) {
34+
console.log("No artifact found with the name docs-build-output, build job was skipped");
35+
return { found: false };
36+
}
37+
38+
return { found: true, id: matchArtifact.id };
39+
40+
- name: Determine deploy parameters
41+
id: parameters
42+
uses: actions/github-script@v7
43+
with:
44+
script: |
45+
// Extract event type and fork status
46+
const eventType = context.payload.workflow_run.event;
47+
const isFork = context.payload.workflow_run.repository.fork;
48+
49+
let parameters;
50+
console.log({eventType, isFork});
51+
52+
// Handle push events
53+
if (eventType == "push") {
54+
const branch = context.payload.workflow_run.head_branch;
55+
console.log({branch});
56+
const shouldDeploy = !isFork && branch == "master";
57+
parameters = {
58+
event: "branch",
59+
name: "master",
60+
shouldDeploy
61+
};
62+
// Handle pull request events
63+
} else if (eventType == "pull_request") {
64+
let pull_number = context.payload.workflow_run.pull_requests[0]?.number;
65+
if (!pull_number) {
66+
const response = await github.rest.search.issuesAndPullRequests({
67+
q: `repo:${context.repo.owner}/${context.repo.repo} is:pr sha:${context.payload.workflow_run.head_sha}`,
68+
per_page: 1,
69+
});
70+
const items = response.data.items;
71+
if (items.length < 1) {
72+
throw new Error("No pull request found for the commit");
73+
}
74+
pull_number = items[0].number;
75+
}
76+
const { data: pr } = await github.rest.pulls.get({
77+
owner: context.repo.owner,
78+
repo: context.repo.repo,
79+
pull_number
80+
});
81+
console.log({ pull_number });
82+
parameters = {
83+
event: "pr",
84+
name: `pr-${pull_number}`,
85+
pr_number: pull_number,
86+
shouldDeploy: true
87+
};
88+
// Handle release events
89+
} else if (eventType == "release") {
90+
parameters = {
91+
event: "release",
92+
name: context.payload.workflow_run.head_branch,
93+
shouldDeploy: !isFork
94+
};
95+
}
96+
97+
console.log(parameters);
98+
return parameters;
99+
100+
deploy:
101+
name: Docs Deploy
102+
runs-on: ubuntu-latest
103+
needs: checks
104+
if: ${{ fromJson(needs.checks.outputs.artifact).found && fromJson(needs.checks.outputs.parameters).shouldDeploy }}
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v4
108+
109+
- name: Load parameters
110+
id: parameters
111+
uses: actions/github-script@v7
112+
with:
113+
script: |
114+
const json = `${{ needs.checks.outputs.parameters }}`;
115+
const parameters = JSON.parse(json);
116+
core.setOutput("event", parameters.event);
117+
core.setOutput("name", parameters.name);
118+
core.setOutput("shouldDeploy", parameters.shouldDeploy);
119+
120+
- run: |
121+
echo "Starting docs deployment for ${{ steps.parameters.outputs.event }} ${{ steps.parameters.outputs.name }}"
122+
123+
- name: Download artifact
124+
uses: actions/github-script@v7
125+
with:
126+
script: |
127+
let artifact = ${{ needs.checks.outputs.artifact }};
128+
let download = await github.rest.actions.downloadArtifact({
129+
owner: context.repo.owner,
130+
repo: context.repo.repo,
131+
artifact_id: artifact.id,
132+
archive_format: 'zip',
133+
});
134+
let fs = require('fs');
135+
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/docs-build-output.zip`, Buffer.from(download.data));
136+
137+
- name: Unzip artifact
138+
run: unzip "${{ github.workspace }}/docs-build-output.zip" -d "${{ github.workspace }}/docs/build"
139+
140+
- name: Publish to Cloudflare Pages
141+
uses: cloudflare/pages-action@v1
142+
with:
143+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
144+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
145+
projectName: ${{ fromJson(steps.clean.outputs.output).pages_project_name.value }}
146+
workingDirectory: "docs"
147+
directory: "build"
148+
branch: ${{ steps.parameters.outputs.name }}
149+
wranglerVersion: "3"

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
<a href="https://opencollective.com/wizarr"><img alt="Backers" src="https://img.shields.io/opencollective/all/wizarr.svg?label=backers" /></a>
1818
<a href="https://features.wizarr.org"><img alt="Submit Feature Requests" src="https://img.shields.io/badge/vote_now-features?label=features" /></a>
1919
<a href="https://github.com/wizarrrrr/wizarr/issues"><img alt="Github Issues" src="https://img.shields.io/github/issues/wizarrrrr/wizarr" /></a>
20-
<a href="https://github.com/wizarrrrr/wizarr/actions/workflows/release.yml"><img alt="GitHub Build" src="https://img.shields.io/github/actions/workflow/status/wizarrrrr/wizarr/release.yml" /></a>
20+
<a href="https://github.com/wizarrrrr/wizarr/actions/workflows/release.yml"><img alt="GitHub Build" src="https://img.shields.io/github/actions/workflow/status/wizarrrrr/wizarr/docker.yml" /></a>
2121
</p>
2222

2323
---
2424

2525
## Introduction
2626

27-
2827
Wizarr is an open-source software designed to simplify the management of media servers such as Jellyfin, Plex, and Emby. Initially created to allow users to easily invite others to their media servers, Wizarr has rapidly evolved with plans to broaden its scope. The ultimate goal is for Wizarr to become a versatile, centralized server management tool that can seamlessly interact with various APIs, allowing users to manage, configure, and deploy settings across multiple server environments.
2928

3029
> **⚠️ Warning!**
@@ -34,20 +33,20 @@ Wizarr is an open-source software designed to simplify the management of media s
3433
3534
## Features
3635

37-
- Create User Invitations for Plex, Jellyfin & Emby
38-
- Multi-language support with quick switching
39-
- Passkey Authentication for admins
40-
- Advanced configuration options for Invitations
41-
- Auto-add users to systems like **Ombi**, **Jellyseerr**, and **Overseerr**
42-
- Discord Intergration
43-
- Custom On-Boarding Screens for new users
44-
- Live Log output in Web Panel
45-
- Session Management to Logout Remote Computers
46-
- Live Notification System
47-
- Swagger API Documentation
48-
- Light/Dark Mode
49-
- Postgres/Sqlite Supported
50-
- Supports Unlimited Servers
36+
- Create User Invitations for Plex, Jellyfin & Emby
37+
- Multi-language support with quick switching
38+
- Passkey Authentication for admins
39+
- Advanced configuration options for Invitations
40+
- Auto-add users to systems like **Ombi**, **Jellyseerr**, and **Overseerr**
41+
- Discord Intergration
42+
- Custom On-Boarding Screens for new users
43+
- Live Log output in Web Panel
44+
- Session Management to Logout Remote Computers
45+
- Live Notification System
46+
- Swagger API Documentation
47+
- Light/Dark Mode
48+
- Postgres/Sqlite Supported
49+
- Supports Unlimited Servers
5150

5251
---
5352

@@ -59,15 +58,17 @@ Wizarr is an open-source software designed to simplify the management of media s
5958
> incomplete and not ready for Live Production use.
6059
6160
**JUST FOR TESTERS**
61+
6262
1. Clone the repo to your local computer & then enter the root directory for Wizarr:<br>
6363
`git clone https://github.com/wizarrrrr/wizarr`<br>
6464
`cd ./wizarr/`<br>
65-
3. If you would like to run Wizarr in Developer mode please skip this step, otherwise you can build Wizarr's Docker image:<br>
65+
2. If you would like to run Wizarr in Developer mode please skip this step, otherwise you can build Wizarr's Docker image:<br>
6666
`docker compose -f docker/docker-compose.dev.yml build`<br>
6767
`docker compose -f docker/docker-compose.dev.yml up`<br>
6868
**Your done, you can reach the test version of Wizarr @ http://localhost:5690**<br>
6969

7070
**JUST FOR DEVELOPERS**:<br>
71+
7172
1. Using **Node** Version **22.11.0** & **NPM** Version **10.9.0** install the dependencies required:<br>
7273
`npm install`<br>
7374
2. Build Wizarr by running the following:<br>

docker/docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,16 @@ services:
6868
-c shared_buffers=512MB
6969
-c wal_compression=on
7070
restart: always
71+
memcached:
72+
container_name: wizarr_memcached
73+
restart: always
74+
image: "memcached:1.6.26-alpine"
75+
command:
76+
- --conn-limit=1024
77+
- --memory-limit=64
78+
- --threads=4
79+
healthcheck:
80+
test: echo stats | nc 127.0.0.1 11211
81+
interval: 20s
82+
timeout: 1s
83+
retries: 5

0 commit comments

Comments
 (0)