Publishes a directory as the GitHub Pages website for the current repository.
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/publish-github-pages@v7
Please, note: this action is automatically run by publish-npm-package, publish-rust-crate and publish-rust-wasm.
-
If
source-directory
is set to an empty string (the default) or refers to a missing directory, ifoptional
is set to true the action will simply exit, otherwise the workflow will fail. -
If
source-directory
contains a package.json file:-
Run enforce-branch-version, forwarding the
enforce-branch-version
input to itsmode
input. -
Set up a NodeJS environment via setup-nodejs-context in
source-directory
. -
Run
pnpm build
. -
The dist subdirectory will contain the actual website.
-
-
If
dry-run
is set to true, interrupt the process without failing. -
Publish the files to GitHub Pages.
-
The following permissions must be set for the action to work:
-
pages
: write -
id-token
: write
Please, note: at the same time, you may want to declare your required default permissions - such as
contents
, necessary for some Git operations - because, otherwise, they would be disabled by an explicitpermissions
block. -
-
GitHub Pages must be enabled for the current repository - and having GitHub Actions as their source.
-
It is recommended that GitHub Actions have read/write permissions on the repository.
-
Please, refer to setup-nodejs-context for details about setting up a NodeJS environment.
Name | Type | Description | Default value |
---|---|---|---|
source-directory |
string | Directory containing the website | . |
optional |
boolean | Whether source-directory can be empty string or missing directory |
false |
enforce-branch-version |
inject ,check ,skip |
How the branch version should be enforced | inject |
dry-run |
boolean | Stop the publication just before uploading | false |
Name | Type | Description | Example |
---|---|---|---|
url |
string | The URL of the published website | HTTPS url |