Code Monkey home page Code Monkey logo

x-oss-byte-_-deploy-pages's Introduction

deploy-pages ๐Ÿš€

Release Linting Formatting Tests Coverage Distributables CodeQL

This action is used to deploy Actions artifacts to GitHub Pages.

Usage

See action.yml for the various inputs this action supports.

For examples that make use of this action, check out our starter-workflows in a variety of frameworks.

This action expects an artifact named github-pages to have been created prior to execution. This is done automatically when using actions/upload-pages-artifact.

We recommend this action to be used in a dedicated job:

jobs:
  # Build job
  build:
    # <Not provided for brevity>
    # At a minimum this job should upload artifacts using actions/upload-pages-artifact

  # Deploy job
  deploy:
    # Add a dependency to the build job
    needs: build

    # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
    permissions:
      pages: write      # to deploy to Pages
      id-token: write   # to verify the deployment originates from an appropriate source

    # Deploy to the github-pages environment
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}

    # Specify runner + deployment step
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action

Inputs ๐Ÿ“ฅ

Input Required? Default Description
token true ${{ github.token }} The GitHub token used to create an authenticated client - Provided for you by default!
timeout false "600000" Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes)
error_count false "10" Maximum number of status report errors before cancelling a deployment (default: 10)
reporting_interval false "5000" Time in milliseconds between two deployment status report (default: 5 seconds)
artifact_name false "github-pages" The name of the artifact to deploy
preview false "false" Is this attempting to deploy a pull request as a GitHub Pages preview site? (NOTE: This feature is only in alpha currently and is not available to the public!)

Outputs ๐Ÿ“ค

Output Description
page_url The URL of the deployed Pages site

Environment Variables ๐ŸŒŽ

Variable Description
GITHUB_PAGES This environment variable is created and set to the string value "true" so that framework build tools may choose to differentiate their output based on the intended target hosting platform.

Scope

โš ๏ธ Official support for building Pages with Actions is in public beta at the moment.

Security Considerations

There are a few important considerations to be aware of:

  1. The artifact being deployed must have been uploaded in a previous step, either in the same job or a separate job that doesn't execute until the upload is complete.

  2. The job that executes the deployment must at minimum have the following permissions:

    • pages: write
    • id-token: write
  3. The deployment should target the github-pages environment (you may use a different environment name if needed, but this is not recommended.)

  4. If your Pages site is using a source branch, the deployment must originate from this source branch unless your environment is protected in which case the environment protection rules take precedence over the source branch rule

  5. If your Pages site is using GitHub Actions as the source, while not required we highly recommend you also protect your environment (we will configure it by default for you).

Compatibility

This action is primarily design for use with GitHub.com's Actions workflows and Pages deployments. However, certain releases should also be compatible with GitHub Enterprise Server (GHES) 3.7 and above.

Release GHES Compatibility
v2 >= 3.9
v2.x.x >= 3.9
v1 >= 3.7
v1.2.8 >= 3.7
v1.2.7 โš ๏ธ >= 3.9 Incompatible with prior versions!
v1.2.6 >= 3.7
v1.x.x >= 3.7

Release Instructions

In order to release a new version of this Action:

  1. Locate the semantic version of the upcoming release (a draft is maintained by the draft-release workflow).

  2. Publish the draft release from the main branch with semantic version as the tag name, with the checkbox to publish to the GitHub Marketplace checked. โ˜‘๏ธ

  3. After publishing the release, the release workflow will automatically run to create/update the corresponding the major version tag such as v1.

    โš ๏ธ Environment approval is required. Check the Release workflow run list.

License

The scripts and documentation in this project are released under the MIT License.

x-oss-byte-_-deploy-pages's People

Contributors

tcbyrd avatar x-oss-byte avatar yimysty avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.