actions/configure-pages@v6

A GitHub Action to enable Pages, extract various metadata about a site, and configure some supported static site generators.

At a glance

Latest major
v6
Repository
actions/configure-pages
Inputs
4 (1 required)
Outputs
4
Runs using
node24
License
MIT
Last checked

Inputs and outputs come straight from the action's official action.yml. See our editorial standards.

Usage

- uses: actions/configure-pages@v6

When to use it and common pitfalls

Use this GitHub Action to enable GitHub Pages for your repository and configure supported static site generators like Nuxt, Next, Gatsby, or SvelteKit. One common pitfall is forgetting to provide a valid GitHub token with the necessary permissions if you want to enable Pages or configure the site.

Generated by an AI model from the input and output descriptions in the action's own action.yml. Check the input descriptions below before relying on it.

Inputs

NameRequiredDefaultDescription
static_site_generatorNononeOptional static site generator to attempt to configure: "nuxt", "next", "gatsby", or "sveltekit"
generator_config_fileNononeOptional file path to static site generator configuration file
tokenYes${{ github.token }}GitHub token
enablementNofalseTry to enable Pages for the repository if it is not already enabled. This option requires a token other than `GITHUB_TOKEN` to be provided. In the context of a Personal Access Token, the `repo` scope or Pages write permission is required. In the context of a GitHub App, the `administration:write` and `pages:write` permissions are required.

Outputs

NameDescription
base_urlGitHub Pages site full base URL. Examples: "https://octocat.github.io/my-repo", "https://octocat.github.io", "https://www.example.com"
originGitHub Pages site origin. Examples: "https://octocat.github.io", "https://www.example.com"
hostGitHub Pages site host. Examples: "octocat.github.io", "www.example.com"
base_pathGitHub Pages site full base path. Examples: "/my-repo" or ""

Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.

Examples

Prepare a Pages deployment

Enable Pages and expose the site URL before building a static site.

name: Example
on:
  push:
    branches: [main]

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - name: Configure GitHub Pages
        id: pages
        uses: actions/configure-pages@v6
      - name: Use the output
        run: echo "base_url = ${{ steps.pages.outputs.base_url }}"

Each example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.

Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.