mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-21 00:46:29 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2467473b67 | ||
|
|
24cfb5bc53 | ||
|
|
41eee650e2 | ||
|
|
06e20d6efa | ||
|
|
5ed114bebe | ||
|
|
815ca758a7 | ||
|
|
e4f23dde3e | ||
|
|
d6623dd305 | ||
|
|
056b60d531 | ||
|
|
648ade5fef | ||
|
|
c3775b6d06 |
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: ['bcomnes']
|
||||
custom: ['https://bret.io', 'https://neocities.org/donate']
|
||||
31
.github/workflows/neocities.yml
vendored
Normal file
31
.github/workflows/neocities.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Deploy to neocities
|
||||
|
||||
# only run on changes to master
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
# Set up any tools and build steps here
|
||||
# This example uses a Node.js toolchain to build a site
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Install deps and build
|
||||
run: |
|
||||
npm i
|
||||
npm run build
|
||||
# When the dist_dir is ready, deploy it to neocities
|
||||
- name: Deploy to neocities
|
||||
uses: bcomnes/deploy-to-neocities@master # dont use master in production
|
||||
with:
|
||||
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
|
||||
cleanup: false
|
||||
dist_dir: public
|
||||
14
CHANGELOG.md
14
CHANGELOG.md
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
## [v1.0.5](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.4...v1.0.5) - 2020-02-18
|
||||
|
||||
### Commits
|
||||
|
||||
- bug: fix internal stat check bug [`24cfb5b`](https://github.com/bcomnes/deploy-to-neocities/commit/24cfb5bc53d4ab90387a5209282f0a30a06a6134)
|
||||
|
||||
## [v1.0.4](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.3...v1.0.4) - 2020-02-18
|
||||
|
||||
### Commits
|
||||
|
||||
- feat: add website [`648ade5`](https://github.com/bcomnes/deploy-to-neocities/commit/648ade5fef90e498638f7c584e7ee504641db809)
|
||||
- chore: remove debug statements [`06e20d6`](https://github.com/bcomnes/deploy-to-neocities/commit/06e20d6efaabb4b5fad11bffa2d2dd1fc7c94245)
|
||||
- chore: debugging statements [`5ed114b`](https://github.com/bcomnes/deploy-to-neocities/commit/5ed114bebecb242e06371f8b3d844aaa01cd17dd)
|
||||
|
||||
## [v1.0.3](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.2...v1.0.3) - 2020-02-18
|
||||
|
||||
### Commits
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# deploy-to-neocities
|
||||
|
||||
[](https://github.com/bcomnes/deploy-to-neocities)
|
||||
[](https://github.com/bcomnes/deploy-to-neocities/actions)
|
||||
[](https://github.com/marketplace/actions/deploy-to-neocities)
|
||||
|
||||
<center><img src="logo.png"></center>
|
||||
<center><img src="static/logo.png"></center>
|
||||
|
||||
Efficiently deploy a website to [Neocities][nc].
|
||||
|
||||
@@ -42,6 +44,9 @@ jobs:
|
||||
dist_dir: public
|
||||
```
|
||||
|
||||
- 💻 [Example YML](.github/workflows/neocities.yml)
|
||||
- 🌎 [Example Deploy](https://deploy-to-neocities.neocities.org)
|
||||
|
||||
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
||||
|
||||
Get your sites API token and set a [secret][sec] called `NEOCITIES_API_TOKEN`. Set the `api_token` input on your `deploy-to-neocities` action to `NEOCITIES_API_TOKEN`.
|
||||
@@ -54,7 +59,7 @@ During your workflow, generate the files you want to deploy to [Neocities][nc] i
|
||||
|
||||
Once the build is complete, `deploy-to-neocities` will efficiently upload all new and all changed files to Neocities. Any files on Neocities that don't exist in the `dist_dir` are considered 'orphaned' files. To destructively remove these 'orphaned' files, set the `cleanup` input to `true`.
|
||||
|
||||
You most likely only want to run this on the `master` branch so that only changes committed to `master` result in website updates.
|
||||
You most likely only want to run this on the `master` branch so that only changes committed to `master` result in website updates. Running a test build that does not deploy on all branches and PRs can help catch changes that will break the build.
|
||||
|
||||
### Inputs
|
||||
|
||||
|
||||
31
example.yml
31
example.yml
@@ -1,31 +0,0 @@
|
||||
name: Example usage
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
example:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node: [12]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Use Node.js ${{ matrix.node }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- name: npm install and build
|
||||
run: |
|
||||
npm i
|
||||
npm run build
|
||||
env:
|
||||
CI: true
|
||||
- name: Deploy to neocities
|
||||
uses: bcomnes/deploy-to-neocities@master
|
||||
with:
|
||||
api-token: ${{ secrets.NEOCITIES_API_TOKEN }}
|
||||
distDir: public
|
||||
cleanup: true
|
||||
4
index.js
4
index.js
@@ -9,10 +9,10 @@ const fsp = require('fs').promises
|
||||
async function doDeploy () {
|
||||
const token = core.getInput('api_token')
|
||||
const distDir = path.join(process.cwd(), core.getInput('dist_dir'))
|
||||
const cleanup = core.getInput('cleanup')
|
||||
const cleanup = JSON.parse(core.getInput('cleanup'))
|
||||
|
||||
assert(typeof cleanup === 'boolean', 'Cleanup input must be a boolean "true" or "false"')
|
||||
const stat = await fsp.stat()
|
||||
const stat = await fsp.stat(distDir)
|
||||
assert(stat.isDirectory(), 'dist_dir must be a directory that exists')
|
||||
|
||||
const client = new Neocities(token)
|
||||
|
||||
15
layout.html
Normal file
15
layout.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Deploy to Neocities</title>
|
||||
<meta name='viewport' content='initial-scale=1, viewport-fit=cover'>
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="https://unpkg.com/highlight.js@^9/styles/github.min.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/mine.css@^2/dist/style.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/mine.css@^2/dist/layout.css">
|
||||
</head>
|
||||
<body>
|
||||
<main class="markdown-body"></main>
|
||||
</body>
|
||||
</html>
|
||||
38
node_modules/inherits/package.json
generated
vendored
38
node_modules/inherits/package.json
generated
vendored
@@ -16,13 +16,51 @@
|
||||
"fetchSpec": "^2.0.3"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/asn1.js",
|
||||
"/bl/readable-stream",
|
||||
"/browserify",
|
||||
"/browserify-aes",
|
||||
"/browserify-des",
|
||||
"/browserify-sign",
|
||||
"/browserify/readable-stream",
|
||||
"/chokidar",
|
||||
"/cipher-base",
|
||||
"/concat-stream",
|
||||
"/concat-stream/readable-stream",
|
||||
"/create-hash",
|
||||
"/create-hmac",
|
||||
"/crypto-browserify",
|
||||
"/des.js",
|
||||
"/duplexer2/readable-stream",
|
||||
"/duplexify",
|
||||
"/elliptic",
|
||||
"/from2",
|
||||
"/from2/readable-stream",
|
||||
"/glob",
|
||||
"/hash-base",
|
||||
"/hash.js",
|
||||
"/htmlparser2",
|
||||
"/http-errors",
|
||||
"/hyperquest/readable-stream",
|
||||
"/hyperquest/through2/readable-stream",
|
||||
"/labeled-stream-splicer",
|
||||
"/md5.js",
|
||||
"/module-deps",
|
||||
"/module-deps/readable-stream",
|
||||
"/pumpify",
|
||||
"/read-only-stream/readable-stream",
|
||||
"/readable-stream",
|
||||
"/readdirp/readable-stream",
|
||||
"/ripemd160",
|
||||
"/sha.js",
|
||||
"/split2/readable-stream",
|
||||
"/stdout-stream/readable-stream",
|
||||
"/stream-browserify",
|
||||
"/stream-browserify/readable-stream",
|
||||
"/stream-combiner2/readable-stream",
|
||||
"/stream-http",
|
||||
"/stream-splicer",
|
||||
"/stream-splicer/readable-stream",
|
||||
"/through2/readable-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
|
||||
4
node_modules/ms/package.json
generated
vendored
4
node_modules/ms/package.json
generated
vendored
@@ -17,7 +17,9 @@
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/",
|
||||
"/debug"
|
||||
"/cpx2/debug",
|
||||
"/dependency-check/debug",
|
||||
"/eslint/debug"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
"_shasum": "d09d1f357b443f493382a8eb3ccd183872ae6009",
|
||||
|
||||
1
node_modules/once/package.json
generated
vendored
1
node_modules/once/package.json
generated
vendored
@@ -16,6 +16,7 @@
|
||||
"fetchSpec": "^1.3.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/budo",
|
||||
"/end-of-stream",
|
||||
"/glob",
|
||||
"/inflight",
|
||||
|
||||
4
node_modules/readable-stream/package.json
generated
vendored
4
node_modules/readable-stream/package.json
generated
vendored
@@ -16,7 +16,9 @@
|
||||
"fetchSpec": "^3.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/duplexify"
|
||||
"/duplexify",
|
||||
"/htmlparser2",
|
||||
"/stream-http"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"_shasum": "337bbda3adc0706bd3e024426a286d4b4b2c9198",
|
||||
|
||||
15
node_modules/safe-buffer/package.json
generated
vendored
15
node_modules/safe-buffer/package.json
generated
vendored
@@ -16,9 +16,24 @@
|
||||
"fetchSpec": "~5.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/browser-pack",
|
||||
"/browserify-aes",
|
||||
"/browserify-des",
|
||||
"/cipher-base",
|
||||
"/cpx2",
|
||||
"/create-hmac",
|
||||
"/evp_bytestokey",
|
||||
"/got",
|
||||
"/hash-base",
|
||||
"/md5.js",
|
||||
"/parse-asn1",
|
||||
"/pbkdf2",
|
||||
"/public-encrypt",
|
||||
"/randombytes",
|
||||
"/randomfill",
|
||||
"/registry-auth-token",
|
||||
"/request",
|
||||
"/sha.js",
|
||||
"/string_decoder",
|
||||
"/tunnel-agent"
|
||||
],
|
||||
|
||||
1
node_modules/string_decoder/package.json
generated
vendored
1
node_modules/string_decoder/package.json
generated
vendored
@@ -16,6 +16,7 @@
|
||||
"fetchSpec": "^1.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/browserify",
|
||||
"/readable-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
|
||||
11
node_modules/util-deprecate/package.json
generated
vendored
11
node_modules/util-deprecate/package.json
generated
vendored
@@ -17,7 +17,18 @@
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bl/readable-stream",
|
||||
"/browserify/readable-stream",
|
||||
"/concat-stream/readable-stream",
|
||||
"/duplexer2/readable-stream",
|
||||
"/from2/readable-stream",
|
||||
"/module-deps/readable-stream",
|
||||
"/read-only-stream/readable-stream",
|
||||
"/readable-stream",
|
||||
"/readdirp/readable-stream",
|
||||
"/stdout-stream/readable-stream",
|
||||
"/stream-browserify/readable-stream",
|
||||
"/stream-combiner2/readable-stream",
|
||||
"/stream-splicer/readable-stream",
|
||||
"/through2/readable-stream"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
|
||||
1
node_modules/wrappy/package.json
generated
vendored
1
node_modules/wrappy/package.json
generated
vendored
@@ -17,6 +17,7 @@
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/inflight",
|
||||
"/map-limit/once",
|
||||
"/once"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
|
||||
23
package.json
23
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "deploy-to-neocities",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"description": "Github Action to deplpoy a folder to Neocities.org",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
@@ -13,8 +13,15 @@
|
||||
"version:1-changelog": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING:' && git add CHANGELOG.md",
|
||||
"version:2-cleandeps": "mv node_modules tmp_modules && npm i --only=prod && git add node_modules --force",
|
||||
"postversion": "rm -rf node_modules && mv tmp_modules node_modules",
|
||||
"clean": "rimraf dist && mkdirp dist",
|
||||
"build": "mkdir public && cp package.json public/test.json"
|
||||
"clean": "rimraf public && mkdirp public",
|
||||
"build": "npm run clean && run-p build:*",
|
||||
"build:md": "sitedown . -b public -l layout.html",
|
||||
"build:static": "cpx 'static/*' public",
|
||||
"start": "npm run watch",
|
||||
"watch": "npm run clean && run-p watch:*",
|
||||
"watch:js": "budo --dir public --live --open",
|
||||
"watch:md": "npm run build:md -- -w",
|
||||
"watch:static": "npm run build:static -- --watch"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -29,20 +36,18 @@
|
||||
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
|
||||
"devDependencies": {
|
||||
"auto-changelog": "^1.16.2",
|
||||
"budo": "^11.6.3",
|
||||
"cpx2": "^2.0.0",
|
||||
"dependency-check": "^4.1.0",
|
||||
"gh-release": "^3.5.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"standard": "^14.3.1"
|
||||
"standard": "^14.3.1",
|
||||
"sitedown": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.2.2",
|
||||
"async-neocities": "1.1.6",
|
||||
"ms": "^2.1.2",
|
||||
"nanoassert": "^2.0.0"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"dist"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
Reference in New Issue
Block a user