|
1 | 1 | # StaticPages Upload GitHub Action
|
2 | 2 |
|
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 | |
4 | 27 |
|
5 | 28 | ## Example Usage
|
6 | 29 |
|
7 | 30 | ```yaml
|
8 |
| -name: SpechtLabs Static-Pages deploy |
| 31 | +name: Deploy Static Site |
9 | 32 |
|
10 | 33 | on:
|
11 | 34 | workflow_dispatch:
|
12 | 35 | push:
|
13 | 36 | branches: [main]
|
14 | 37 |
|
15 | 38 | permissions:
|
16 |
| - id-token: write |
17 |
| - contents: read |
| 39 | + id-token: write # Required for OIDC authentication |
| 40 | + contents: read # To read repository contents |
18 | 41 |
|
19 | 42 | jobs:
|
20 | 43 | deploy:
|
21 | 44 | runs-on: ubuntu-latest
|
22 | 45 | steps:
|
23 |
| - - name: Git checkout |
24 |
| - uses: actions/checkout@v3 |
| 46 | + - name: Checkout repository |
| 47 | + uses: actions/checkout@v4 |
25 | 48 | with:
|
26 |
| - submodules: recursive # fetch Hugo themes |
| 49 | + submodules: recursive |
27 | 50 | fetch-depth: 0
|
28 | 51 |
|
29 |
| - - name: Init submodules |
| 52 | + - name: Initialize submodules |
30 | 53 | run: git submodule update --init --recursive
|
31 | 54 |
|
32 |
| - - name: Setup hugo |
| 55 | + - name: Setup Hugo |
33 | 56 | uses: peaceiris/actions-hugo@v2
|
34 | 57 | with:
|
35 | 58 | hugo-version: "latest"
|
36 | 59 | extended: true
|
37 | 60 |
|
38 |
| - - name: Build |
| 61 | + - name: Build site |
39 | 62 | run: hugo --minify
|
40 | 63 |
|
41 |
| - - uses: SpechtLabs/StaticPages-Upload@v1 |
| 64 | + - name: Upload to Static Pages |
| 65 | + uses: SpechtLabs/StaticPages-Upload@v1 |
42 | 66 | 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