mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-21 00:46:29 +00:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f942ee85ee | ||
|
|
06656fc11f | ||
|
|
e3a5a21e0f | ||
|
|
98ed70e10b | ||
|
|
4651b4e6a6 | ||
|
|
e95b2b3a31 | ||
|
|
6a1edb8f7c | ||
|
|
b34dbdf936 | ||
|
|
3e3947a94e | ||
|
|
c10801ca7d | ||
|
|
c29ab1ac72 | ||
|
|
bf078bf3d1 | ||
|
|
5346499faa | ||
|
|
ebebe2f466 | ||
|
|
0a714c56e7 | ||
|
|
085e43c0f6 | ||
|
|
a681c7b834 | ||
|
|
0e025d4443 | ||
|
|
0f708da077 | ||
|
|
2f93b28470 | ||
|
|
c97c0f1d29 | ||
|
|
bd95686640 | ||
|
|
26e9f892dc | ||
|
|
44344826ee | ||
|
|
07e0747714 | ||
|
|
de4011a7a2 | ||
|
|
c465c2edba | ||
|
|
68257ae7e3 | ||
|
|
f6865eddb1 | ||
|
|
963a76669c | ||
|
|
19f4a14056 | ||
|
|
88a58f8af5 | ||
|
|
9e5dafc00e |
2
.github/workflows/neocities.yml
vendored
2
.github/workflows/neocities.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
# 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@v2.1.1
|
||||
uses: actions/setup-node@v2.1.4
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Install deps and build
|
||||
|
||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -18,12 +18,14 @@ jobs:
|
||||
with:
|
||||
# fetch full history so things like auto-changelog work properly
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v2.1.1
|
||||
- uses: actions/setup-node@v2.1.4
|
||||
with:
|
||||
node-version: ${{ env.node_version }}
|
||||
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- uses: bcomnes/npm-bump@v1.0.4
|
||||
- run: npm i
|
||||
- run: npm test
|
||||
- uses: bcomnes/npm-bump@v2.0.2
|
||||
with:
|
||||
git_email: bcomnes@gmail.com
|
||||
git_username: ${{ github.actor }}
|
||||
|
||||
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@@ -1,6 +1,6 @@
|
||||
name: tests
|
||||
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -14,12 +14,19 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node }}
|
||||
uses: actions/setup-node@v2.1.1
|
||||
uses: actions/setup-node@v2.1.4
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- name: npm install && npm test
|
||||
run: |
|
||||
npm i
|
||||
npm test
|
||||
env:
|
||||
CI: true
|
||||
|
||||
automerge:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: fastify/github-action-merge-dependabot@v1.1.1
|
||||
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' && contains(github.head_ref, 'dependabot/github_actions') }}
|
||||
with:
|
||||
github-token: ${{secrets.github_token}}
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ config.json
|
||||
public
|
||||
node_modules
|
||||
tmp_modules
|
||||
package-lock.json
|
||||
|
||||
36
CHANGELOG.md
36
CHANGELOG.md
@@ -7,6 +7,42 @@ 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.15](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.14...v1.0.15)
|
||||
|
||||
### Merged
|
||||
|
||||
- Clarify usage instructions [`#26`](https://github.com/bcomnes/deploy-to-neocities/pull/26)
|
||||
- chore(deps): bump actions/setup-node from v2.1.3 to v2.1.4 [`#25`](https://github.com/bcomnes/deploy-to-neocities/pull/25)
|
||||
- chore(deps): bump actions/setup-node from v2.1.2 to v2.1.3 [`#23`](https://github.com/bcomnes/deploy-to-neocities/pull/23)
|
||||
- chore(deps-dev): bump sitedown from 4.0.0 to 5.0.0 [`#24`](https://github.com/bcomnes/deploy-to-neocities/pull/24)
|
||||
- chore(deps-dev): bump standard from 15.0.1 to 16.0.0 [`#22`](https://github.com/bcomnes/deploy-to-neocities/pull/22)
|
||||
- chore(deps-dev): bump standard from 14.3.4 to 15.0.0 [`#21`](https://github.com/bcomnes/deploy-to-neocities/pull/21)
|
||||
- chore(deps): bump bcomnes/npm-bump from v2.0.1 to v2.0.2 [`#20`](https://github.com/bcomnes/deploy-to-neocities/pull/20)
|
||||
- chore(deps): bump actions/setup-node from v2.1.1 to v2.1.2 [`#19`](https://github.com/bcomnes/deploy-to-neocities/pull/19)
|
||||
- chore(deps): bump @actions/core from 1.2.5 to 1.2.6 [`#18`](https://github.com/bcomnes/deploy-to-neocities/pull/18)
|
||||
- chore(deps-dev): bump cpx2 from 2.0.0 to 3.0.0 [`#17`](https://github.com/bcomnes/deploy-to-neocities/pull/17)
|
||||
- chore(deps): bump bcomnes/npm-bump from v1.0.5 to v2.0.0 [`#16`](https://github.com/bcomnes/deploy-to-neocities/pull/16)
|
||||
- chore(deps): bump bcomnes/npm-bump from v1.0.4 to v1.0.5 [`#14`](https://github.com/bcomnes/deploy-to-neocities/pull/14)
|
||||
|
||||
### Commits
|
||||
|
||||
- Print file stats when things error. [`06656fc`](https://github.com/bcomnes/deploy-to-neocities/commit/06656fc11f192e070e32acf845e0631d792ee424)
|
||||
- Update test.yml [`e95b2b3`](https://github.com/bcomnes/deploy-to-neocities/commit/e95b2b3a311c11aa7a114d96f773013eef154f52)
|
||||
- Update release.yml [`4434482`](https://github.com/bcomnes/deploy-to-neocities/commit/44344826ee59da570fa6d5ca8285cd67693cc6aa)
|
||||
|
||||
## [v1.0.14](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.13...v1.0.14) - 2020-09-14
|
||||
|
||||
### Merged
|
||||
|
||||
- chore(deps-dev): bump gh-release from 3.5.0 to 4.0.0 [`#15`](https://github.com/bcomnes/deploy-to-neocities/pull/15)
|
||||
|
||||
## [v1.0.13](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.12...v1.0.13) - 2020-09-11
|
||||
|
||||
### Commits
|
||||
|
||||
- Delete package-lock.json [`88a58f8`](https://github.com/bcomnes/deploy-to-neocities/commit/88a58f8af50d3ac41ce4e523597434adfa6fa304)
|
||||
- Update .gitignore [`9e5dafc`](https://github.com/bcomnes/deploy-to-neocities/commit/9e5dafc00e3910658e768ad1de0a08512399bd51)
|
||||
|
||||
## [v1.0.12](https://github.com/bcomnes/deploy-to-neocities/compare/v1.0.11...v1.0.12) - 2020-09-11
|
||||
|
||||
### Merged
|
||||
|
||||
10
README.md
10
README.md
@@ -48,15 +48,17 @@ jobs:
|
||||
- 💻 [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).
|
||||
Create a workflow `.yml` file in your repository's `.github/workflows` directory. An [example workflow](#example-workflow) is available above. 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`.
|
||||
You'll need the API token for your site. Go to:
|
||||
|
||||
```
|
||||
https://neocities.org/settings/{{sitename}}#api_key
|
||||
https://neocities.org/settings/{{your-sitename}}#api_key
|
||||
```
|
||||
|
||||
During your workflow, generate the files you want to deploy to [Neocities][nc] into a `dist_dir` directory. You can use any tools that can be installed or brought into the Github actions environment.
|
||||
Get your site's API token. In your GitHub repository, set a [secret][sec] called `NEOCITIES_API_TOKEN`. Set the `api_token` input on your `deploy-to-neocities` action to `${{ secrets.NEOCITIES_API_TOKEN }}` as in the example above.
|
||||
|
||||
During your workflow, generate the files you want to deploy to [Neocities][nc] into a directory. Set this as the `dist_dir` directory in your workflow (the default is `public`). You can use any tools to generate your site that can be installed or brought into the Github actions environment.
|
||||
|
||||
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`.
|
||||
|
||||
|
||||
254
dist/index.js
vendored
254
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
14
index.js
14
index.js
@@ -6,10 +6,12 @@ const ms = require('ms')
|
||||
const assert = require('webassert').default
|
||||
const fsp = require('fs').promises
|
||||
|
||||
let cleanup
|
||||
|
||||
async function doDeploy () {
|
||||
const token = core.getInput('api_token')
|
||||
const distDir = path.join(process.cwd(), core.getInput('dist_dir'))
|
||||
const cleanup = JSON.parse(core.getInput('cleanup'))
|
||||
cleanup = JSON.parse(core.getInput('cleanup'))
|
||||
|
||||
assert(typeof cleanup === 'boolean', 'Cleanup input must be a boolean "true" or "false"')
|
||||
const stat = await fsp.stat(distDir)
|
||||
@@ -30,5 +32,15 @@ async function doDeploy () {
|
||||
|
||||
doDeploy().catch(err => {
|
||||
console.error(err)
|
||||
if (err.stats) {
|
||||
console.log('Files to upload: ')
|
||||
console.dir(err.stats.filesToUpload, { colors: true, depth: 999 })
|
||||
|
||||
if (cleanup) {
|
||||
console.log('Files to delete: ')
|
||||
console.dir(err.stats.filesToDelete, { colors: true, depth: 999 })
|
||||
}
|
||||
}
|
||||
|
||||
core.setFailed(err.message)
|
||||
})
|
||||
|
||||
8024
package-lock.json
generated
8024
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -1,27 +1,27 @@
|
||||
{
|
||||
"name": "deploy-to-neocities",
|
||||
"description": "Github Action to deplpoy a folder to Neocities.org",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.15",
|
||||
"author": "Bret Comnes <bcomnes@gmail.com> (https://bret.io/)",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bcomnes/deploy-to-neocities/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "1.2.5",
|
||||
"async-neocities": "1.1.6",
|
||||
"ms": "^2.1.2",
|
||||
"webassert": "^3.0.2"
|
||||
"@actions/core": "1.2.6",
|
||||
"async-neocities": "1.1.7",
|
||||
"ms": "2.1.2",
|
||||
"webassert": "3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"auto-changelog": "^2.0.0",
|
||||
"@zeit/ncc": "^0.22.0",
|
||||
"budo": "^11.6.3",
|
||||
"cpx2": "^2.0.0",
|
||||
"cpx2": "^3.0.0",
|
||||
"dependency-check": "^4.1.0",
|
||||
"gh-release": "^3.5.0",
|
||||
"gh-release": "^4.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"sitedown": "^4.0.0",
|
||||
"standard": "^14.3.1"
|
||||
"sitedown": "^5.0.0",
|
||||
"standard": "^16.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
|
||||
"keywords": [],
|
||||
|
||||
Reference in New Issue
Block a user