npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

deploy-pr-action

v1.5.0

Published

Deploy every pull request to a static URL

Downloads

14

Readme

🚀🎬 Deploy PR Action

This is a GitHub Action that automatically deploys all pull requests and branches as a static site using Surge.sh.

Test CI Release CI Node CI

⭐ Features

  • Auto-deploy every PR and branch to its unique environment
  • Unlimited free static site deployments, thanks to Surge.sh
  • No search engine indexing for branch sites (robots.txt injection)
  • Label and comment on PRs with the deployment and log URLs
  • Update your staging GitHub environment status

⚙️ Usage

Inputs

distDir (required)

The directory to deploy, for example dist or public

prefix

Prefix for deployment URL, e.g., example will translate to https://example-PR_NAME.surge.sh

robotsTxtPath

Generate a robots.txt file to prevent search engines from indexing the deployment

robotsContent

Content for robots.txt file, defaults to:

User-agent: *
Disallow: /

environmentName

Name of the deployment environment on GitHub, defaults to "Preview"

skipComment

Skip adding the deployment details comment, defaults to false

skipLabels

Skip adding the labels to pull requests, defaults to false

labels

Labels to add to pull requests as a comma-separated list, defaults to deployed

Environment variables

GITHUB_TOKEN (required)

The GitHub token is required to add labels, comments, etc., on the PR: GITHUB_TOKEN: ${{ secrets.GH_PAT }}

SURGE_LOGIN (required)

Your Surge.sh email address, required to deploy site to Surge.sh

SURGE_TOKEN (required)

Your Surge.sh login token, required to deploy site to Surge.sh (get it by doing surge token)

Example

name: Deploy CI
on:
  issue_comment:
    types: [created]
  push:
    branches-ignore:
      - master
  pull_request:
    types:
      - opened
      - edited
      - synchronize
jobs:
  release:
    name: Deploy website
    runs-on: ubuntu-18.04
    if: "!contains(github.event.head_commit.message, '[skip ci]') && (contains(github.event.comment.body, 'Deploy') || contains(github.event.comment.body, 'deploy') || github.event_name == 'push' || github.event_name == 'pull_request')"
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 12
      - name: Install dependencies
        run: npm ci
      - name: Build static site
        run: npm run build # Build your website
      - name: Deploy
        uses: koj-co/[email protected]
        with:
          prefix: example # Prefix for deployment URL
          robotsTxtPath: dist/robots.txt # Add robots.txt file
          distDir: dist # Path to dist directory
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token
          SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} # Surge.sh email
          SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} # Surge.sh token

📄 License

  • Code: MIT © Koj
  • "GitHub" is a trademark of GitHub, Inc.