Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
publish to actions org
  • Loading branch information
Tommy Byrd committed Dec 14, 2021
0 parents commit 3cef362
Show file tree
Hide file tree
Showing 28 changed files with 28,531 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -0,0 +1,2 @@
node_modules/
dist/
19 changes: 19 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,19 @@
{
"env": {
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"semi": ["error", "never"]
}
}
44 changes: 44 additions & 0 deletions .github/workflows/check-dist.yml
@@ -0,0 +1,44 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file using `ncc`
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: npm run prepare

- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,24 @@
name: Run Tests
on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set Node.JS
uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Install dependencies
run: npm install

- name: Run tests
run: npm run test
67 changes: 67 additions & 0 deletions .gitignore
@@ -0,0 +1,67 @@
node_modules/

# Editors
.vscode/
.idea/
*.iml

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Other Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
1 change: 1 addition & 0 deletions .prettierignore
@@ -0,0 +1 @@
node_modules/
10 changes: 10 additions & 0 deletions .prettierrc.json
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid"
}
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 17 additions & 0 deletions README.md
@@ -0,0 +1,17 @@
# Deploy-Pages

This deploys artifacts to GitHub Pages.

# Scope

⚠️ Official support for building Pages with Actions is in public beta at the moment. The scope is currently limited to **public repositories only**.

# Usage

See [action.yml](action.yml)

<!-- TODO: document custom workflow -->

# License

The scripts and documentation in this project are released under the [MIT License](LICENSE).
23 changes: 23 additions & 0 deletions action.yml
@@ -0,0 +1,23 @@
name: 'Deploy to GitHub Pages'
description: 'A GitHub Action to deploy an artifact to GitHub Pages'
runs:
using: 'node16'
main: 'dist/index.js'
pre: 'pre/index.js'
inputs:
token:
description: 'GitHub token'
default: ${{ github.token }}
required: true
timeout:
description: 'Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes)'
required: false
default: "600000"
error_count:
description: 'Maximum number of status report errors before cancelling a deployment (default: 10)'
required: false
default: "10"
reporting_interval:
description: 'Time in milliseconds between two deployment status report (default: 1 second)'
required: false
default: "1000"
1 change: 1 addition & 0 deletions babel.config.js
@@ -0,0 +1 @@
module.exports = {presets: ['@babel/preset-env']}

0 comments on commit 3cef362

Please sign in to comment.