Skip to content

Commit a2d6704

Browse files
committed
doc: updated usage section in readme
1 parent 984864e commit a2d6704

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,59 @@ A composite Action for packaging and uploading artifact that can be deployed to
44

55
## Usage
66

7-
See [action.yml](action.yml)
7+
See [action.yml](action.yml) for the various `inputs` this action supports (or [below](#inputs-📥)).
8+
9+
We recommend this action to be used in the build job:
10+
11+
```yaml
12+
jobs:
13+
# Build job
14+
build:
15+
16+
# Specify runner + build & upload the static files as an artifact
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Build static files
20+
id: build
21+
run: |
22+
# <Not provided for brevity>
23+
# At a minimum this step should build the static files of your site
24+
# <Not provided for brevity>
25+
26+
- name: Upload static files as artifact
27+
id: deployment
28+
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
29+
with:
30+
path: build_outputs_folder/
31+
32+
# Deployment job
33+
deploy:
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
37+
runs-on: ubuntu-latest
38+
needs: build
39+
steps:
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v4
43+
44+
```
45+
46+
### Inputs 📥
47+
48+
| Input | Required? | Default | Description |
49+
| ---------------- | --------- | ----------------------- | -------------------------------------------------- |
50+
| `name` | `false` | `github-pages` | Artifact name |
51+
| `path` | `true` | `_site/` | Path of the directory containing the static assets |
52+
| `retention-days` | `false` | `1` | Duration after which artifact will expire in days |
53+
54+
### Outputs 📤
55+
56+
| Output | Description |
57+
| ------------- | ---------------------------------------- |
58+
| `artifact_id` | The ID of the artifact that was uploaded |
859

9-
<!-- TODO: document custom workflow -->
1060

1161
## Artifact validation
1262

0 commit comments

Comments
 (0)