-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/bevry/es-versions/tree/8c5e701543151d758f229489d75a5f55abbb8b1a/.github which extracted from awesome-travis https://github.com/bevry-archive/awesome-travis/blob/9fa2fa025c77b463d03154f39922af95cadc9c67/scripts/surge.bash
- Loading branch information
Showing
5 changed files
with
236 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 2018 September 26 | ||
# https://github.com/bevry/base | ||
|
||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false | ||
indent_style = tab | ||
|
||
[{*.mk,*.py}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[*.md] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[{*.json,*.lsrules,*.yml,*.bowerrc,*.babelrc}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[{*.json,*.lsrules}] | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 2020 June 3 | ||
# https://github.com/bevry/base | ||
|
||
# System Files | ||
**/.DS_Store | ||
|
||
# Temp Files | ||
**/.docpad.db | ||
**/*.log | ||
**/*.cpuprofile | ||
**/*.heapsnapshot | ||
|
||
# Editor Files | ||
.c9/ | ||
.vscode/ | ||
|
||
# Yarn Files | ||
.yarn/* | ||
!.yarn/releases | ||
!.yarn/plugins | ||
!.yarn/sdks | ||
!.yarn/versions | ||
.pnp.* | ||
.pnp/ | ||
|
||
# Private Files | ||
.env | ||
.idea | ||
.cake_task_cache | ||
|
||
# Build Caches | ||
build/ | ||
bower_components/ | ||
node_modules/ | ||
.next/ | ||
|
||
# ------------------------------------- | ||
# CDN Inclusions, Git Exclusions | ||
|
||
# Build Outputs | ||
**/out.* | ||
**/*.out.* | ||
**/out/ | ||
**/output/ | ||
*compiled* | ||
edition*/ | ||
coffeejs/ | ||
coffee/ | ||
es5/ | ||
es2015/ | ||
esnext/ | ||
docs/ | ||
|
||
# ===================================== | ||
# CUSTOM | ||
|
||
.now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,43 @@ | ||
# surge | ||
GitHub Action to publish your project to https://surge.sh | ||
# bevry-action/surge | ||
|
||
Once your tests succeed, use this action to deploy your commit, branch, and tag to [Surge](https://surge.sh). | ||
|
||
This allows you to git ignore your outputs (e.g. build files, documentation, etc) such that their changes don't make your repository dirty, nor pollute your git history, while allowing you to leverage CDN to referfence your source code and outputs, for every commit, branch, and tag. | ||
|
||
## Example | ||
|
||
For instance, for the [ambi](https://github.com/bevry/ambi) project. | ||
|
||
You can get the rendered documentation for: | ||
|
||
- the [`master` branch](https://github.com/bevry/ambi/tree/master) via | ||
|
||
> http://master.ambi.bevry.surge.sh/docs/globals.html | ||
- the [`v8.22.0`](https://github.com/bevry/ambi/releases/tag/v6.6.0) tag via: | ||
|
||
> http://v8.22.0.ambi.bevry.surge.sh/docs/globals.html | ||
- the [`0250e1ed2cbc01773e0974165d1c9469c922b271` commit](https://github.com/bevry/ambi/commit/0250e1ed2cbc01773e0974165d1c9469c922b271) via: | ||
> http://0250e1ed2cbc01773e0974165d1c9469c922b271.ambi.bevry.surge.sh/docs/globals.html | ||
## Install | ||
|
||
Make sure that the desired surge version you wish to use is installed locally: | ||
|
||
```bash | ||
npm install --save-dev surge | ||
``` | ||
|
||
And add the following to your GitHub Action workflow after your tests have completed and you have built your compile targets/documentation. | ||
|
||
```yaml | ||
- uses: bevry-actions/surge@main | ||
with: | ||
surgeLogin: ${{secrets.SURGE_LOGIN}} | ||
surgeToken: ${{secrets.SURGE_TOKEN}} | ||
``` | ||
## License | ||
Public Domain via The Unlicense |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
set -ueE -o pipefail | ||
|
||
# ===================================== | ||
# AUTOMATIC GITHUB ENVIRONMENT VARIABLES | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables | ||
|
||
# GITHUB_REPOSITORY | ||
# GITHUB_REF | ||
# GITHUB_SHA | ||
|
||
# ===================================== | ||
# MANUAL ENVIRONMENT VARIABLES | ||
|
||
# SURGE_LOGIN | ||
# SURGE_TOKEN | ||
# SURGE_PROJECT | ||
|
||
# ===================================== | ||
# LOCAL ENVIRONMENT VARIABLES | ||
|
||
REPO_TAG="" | ||
REPO_BRANCH="" | ||
REPO_COMMIT="" | ||
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then | ||
REPO_TAG="${GITHUB_REF#"refs/tags/"}" | ||
elif [[ "$GITHUB_REF" == "refs/heads/"* ]]; then | ||
REPO_BRANCH="${GITHUB_REF#"refs/heads/"}" | ||
REPO_COMMIT="$GITHUB_SHA" | ||
else | ||
echo "unknown GITHUB_REF=$GITHUB_REF" | ||
exit 1 | ||
fi | ||
|
||
# org/name => name.org | ||
SURGE_SLUG="$(echo "$GITHUB_REPOSITORY" | sed 's/^\(.*\)\/\(.*\)/\2.\1/')" | ||
|
||
# defaults | ||
if test -z "${SURGE_PROJECT-}"; then | ||
SURGE_PROJECT="." | ||
fi | ||
|
||
# ===================================== | ||
# CHECKS | ||
|
||
if [[ "$REPO_BRANCH" = *"dependabot"* ]]; then | ||
echo "skipping as running on a dependabot branch" | ||
exit 0 | ||
elif test -z "${SURGE_LOGIN-}" -o -z "${SURGE_TOKEN-}"; then | ||
echo "you must provide a SURGE_LOGIN + SURGE_TOKEN combination" | ||
exit 1 | ||
fi | ||
|
||
# ===================================== | ||
# RUN | ||
|
||
targets=() | ||
|
||
if test -n "$REPO_BRANCH"; then | ||
targets+=("$REPO_BRANCH.$SURGE_SLUG.surge.sh") | ||
fi | ||
if test -n "$REPO_TAG"; then | ||
targets+=("$REPO_TAG.$SURGE_SLUG.surge.sh") | ||
fi | ||
if test "$REPO_COMMIT"; then | ||
targets+=("$REPO_COMMIT.$SURGE_SLUG.surge.sh") | ||
fi | ||
|
||
if test ${#targets[@]} -eq 0; then | ||
echo 'failed to detect targets' | ||
exit 1 | ||
else | ||
for target in ${targets[*]}; do | ||
echo "deploying $SURGE_PROJECT to $target" | ||
npx --no-install surge --project $SURGE_PROJECT --domain "$target" | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions | ||
name: "bevry-action/surge" | ||
author: "Benjamin Arthur Lupton <b@lupton.cc>" | ||
description: "GitHub Action to publish your project to https://surge.sh" | ||
branding: | ||
icon: "anchor" | ||
color: "green" | ||
|
||
# https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#inputs | ||
inputs: | ||
surgeLogin: | ||
description: "Your Surge email/username, get it via the `surge whoami` command." | ||
required: true | ||
default: "1" | ||
surgeToken: | ||
description: "The token to authorize the deployments to Surge, get via the `surge token` command." | ||
required: true | ||
surgeProject: | ||
description: "The path that you want to deploy to Surge." | ||
default: "." | ||
required: false | ||
|
||
# https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "publish to surge" | ||
run: $GITHUB_ACTION_PATH/action.bash | ||
shell: bash | ||
env: | ||
SURGE_LOGIN: ${{secrets.surgeLogin}} | ||
SURGE_TOKEN: ${{secrets.surgeToken}} | ||
SURGE_PROJECT: ${{secrets.surgeProject}} |