Skip to content

Commit 5341680

Browse files
committed
better README and lint action
1 parent 997ccaa commit 5341680

File tree

2 files changed

+54
-14
lines changed

2 files changed

+54
-14
lines changed

.github/workflows/lint.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Validate Composite Action
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Lint workflows and action.yml
15+
run: |
16+
curl -sSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash
17+
./actionlint

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,68 @@
11
# StaticPages Upload GitHub Action
22

3-
this GitHub Action uploads a static page generated by your static page generator of choice to your self-hosted [Static Pages](https://github.com/SpechtLabs/StaticPages) instance.
3+
**Easily upload your static website to a self-hosted [Static Pages](https://github.com/SpechtLabs/StaticPages) instance using GitHub OIDC authentication.**
4+
5+
This GitHub Action simplifies deploying static sites (e.g., built with Hugo, VuePress, Astro, etc.) by securely uploading your generated files to a Static Pages backend via a single composite step.
6+
7+
## Features
8+
9+
- Simple integration with any static site generator
10+
- Secure authentication using GitHub OIDC
11+
- Fast, parallel file uploads with detailed summaries
12+
- Upload results available in the GitHub Action summary
13+
14+
## Inputs
15+
16+
| Name | Description | Required | Default |
17+
|------------|-----------------------------------------------------------------------------|----------|---------|
18+
| `endpoint` | **Base URL** of your Static Pages API (e.g. `staticpages.example.com`) | **yes** ||
19+
| `site-dir` | Path to the directory containing the **generated static site files** | **yes** ||
20+
| `verbose` | Enable verbose curl output (`true` or `false`) | no | `false` |
21+
22+
## Output
23+
24+
| Name | Description |
25+
|------------------|--------------------------------|
26+
| `uploaded-count` | The number of files uploaded |
427

528
## Example Usage
629

730
```yaml
8-
name: SpechtLabs Static-Pages deploy
31+
name: Deploy Static Site
932

1033
on:
1134
workflow_dispatch:
1235
push:
1336
branches: [main]
1437

1538
permissions:
16-
id-token: write
17-
contents: read
39+
id-token: write # Required for OIDC authentication
40+
contents: read # To read repository contents
1841

1942
jobs:
2043
deploy:
2144
runs-on: ubuntu-latest
2245
steps:
23-
- name: Git checkout
24-
uses: actions/checkout@v3
46+
- name: Checkout repository
47+
uses: actions/checkout@v4
2548
with:
26-
submodules: recursive # fetch Hugo themes
49+
submodules: recursive
2750
fetch-depth: 0
2851

29-
- name: Init submodules
52+
- name: Initialize submodules
3053
run: git submodule update --init --recursive
3154

32-
- name: Setup hugo
55+
- name: Setup Hugo
3356
uses: peaceiris/actions-hugo@v2
3457
with:
3558
hugo-version: "latest"
3659
extended: true
3760

38-
- name: Build
61+
- name: Build site
3962
run: hugo --minify
4063

41-
- uses: SpechtLabs/StaticPages-Upload@v1
64+
- name: Upload to Static Pages
65+
uses: SpechtLabs/StaticPages-Upload@v1
4266
with:
43-
apiUrl: https://staticpages.cedi.dev/upload
44-
dir: public/
45-
```
67+
endpoint: https://staticpages.example.com
68+
site-dir: public/

0 commit comments

Comments
 (0)