mirror of
https://github.com/actions/upload-pages-artifact.git
synced 2025-12-08 08:06:18 +00:00
doc: updated usage section in readme
This commit is contained in:
54
README.md
54
README.md
@@ -4,9 +4,59 @@ A composite Action for packaging and uploading artifact that can be deployed to
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
See [action.yml](action.yml)
|
See [action.yml](action.yml) for the various `inputs` this action supports (or [below](#inputs-📥)).
|
||||||
|
|
||||||
|
We recommend this action to be used in the build job:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
# Build job
|
||||||
|
build:
|
||||||
|
|
||||||
|
# Specify runner + build & upload the static files as an artifact
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Build static files
|
||||||
|
id: build
|
||||||
|
run: |
|
||||||
|
# <Not provided for brevity>
|
||||||
|
# At a minimum this step should build the static files of your site
|
||||||
|
# <Not provided for brevity>
|
||||||
|
|
||||||
|
- name: Upload static files as artifact
|
||||||
|
id: deployment
|
||||||
|
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
|
||||||
|
with:
|
||||||
|
path: build_outputs_folder/
|
||||||
|
|
||||||
|
# Deployment job
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Inputs 📥
|
||||||
|
|
||||||
|
| Input | Required? | Default | Description |
|
||||||
|
| ---------------- | --------- | ----------------------- | -------------------------------------------------- |
|
||||||
|
| `name` | `false` | `github-pages` | Artifact name |
|
||||||
|
| `path` | `true` | `_site/` | Path of the directory containing the static assets |
|
||||||
|
| `retention-days` | `false` | `1` | Duration after which artifact will expire in days |
|
||||||
|
|
||||||
|
### Outputs 📤
|
||||||
|
|
||||||
|
| Output | Description |
|
||||||
|
| ------------- | ---------------------------------------- |
|
||||||
|
| `artifact_id` | The ID of the artifact that was uploaded |
|
||||||
|
|
||||||
<!-- TODO: document custom workflow -->
|
|
||||||
|
|
||||||
## Artifact validation
|
## Artifact validation
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user