Skip to content

Commit 2da5a69

Browse files
committed
Update to the latest async-neocities 4.0
BREAKING CHANGE: api_token action input is renamed to api_key, please update this BREAKING CHANGE: added a required neocities_supporter action input to toggle unsupported file filtering BREAKING CHANGE: addad a preview_before_deploy action input to toggle informational deploy plans prior to deploys BREAKING CHANGE: completely rewrote the underlying library to provide better error handling and reporting BREAKING CHANGE: Remove a bunch of real time stats and progress meters. Deploys were finishing in seconds and these were very complicated to maintain.
1 parent f9a550f commit 2da5a69

File tree

11 files changed

+29431
-11439
lines changed

11 files changed

+29431
-11439
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ public
55
node_modules
66
tmp_modules
77
package-lock.json
8+
coverage

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
Efficiently deploy a website to [Neocities][nc] using [Github actions](https://github.com/features/actions). Uses content aware diffing to only update files that changed.
1212

13+
Alternatively, you can use the bin helper in [async-neocities](https://github.com/bcomnes/async-neocities) to deploy to neocities locally from your own machine as well as in CI.
14+
1315
## Usage
1416

1517
```yaml
@@ -30,23 +32,26 @@ jobs:
3032
runs-on: ubuntu-latest
3133

3234
steps:
33-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3436
# Set up any tools and build steps here
3537
# This example uses a Node.js toolchain to build a site
3638
- name: Use Node.js
37-
uses: actions/setup-node@v3
39+
uses: actions/setup-node@v4
3840
with:
3941
node-version: lts/*
42+
# If you have a different build process, replace this with your own build steps
4043
- name: Install deps and build
4144
run: |
4245
npm i
4346
npm run build
4447
# When the dist_dir is ready, deploy it to neocities
4548
- name: Deploy to neocities
46-
uses: bcomnes/deploy-to-neocities@v2
49+
uses: bcomnes/deploy-to-neocities@v3
4750
with:
4851
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
4952
cleanup: false
53+
neocities_supporter: false # set this to true if you have a supporter account and want to bypass unsuported files filter.
54+
preview_before_deploy: true # print a deployment plan prior to waiting for files to upload.
5055
dist_dir: public
5156
```
5257
@@ -73,7 +78,9 @@ You most likely only want to run this on the `master` branch so that only change
7378

7479
- `api_token` (**REQUIRED**): The API token for your [Neocities][nc] website to deploy to.
7580
- `dist_dir`: The directory to deploy to [Neocities][nc]. Default: `public`. Don't deploy your root repo directory (e.g. `./`). It contains `.git`, `.github` and other files that won't deploy properly to neocities. Keep it clean by keeping or building your site into a subdir and deploy that.
81+
- `neocoties_supporter`: Set this to `true` if you have a paid neocities account and want to bypass the [unsupported files filter](https://neocities.org/site_files/allowed_types).
7682
- `cleanup`: Boolean string (`true` or `false`). If `true`, `deploy-to-neocities` will destructively delete files found on [Neocities][nc] not found in your `dist_dir`. Default: `false`.
83+
- `preview_before_deploy`: Boolean string (`true` or `false`). If `true`, `deploy-to-neocities` will print a preview of the files that will be uploaded and deleted. Default: `true`.
7784
- `protected_files`: An optional glob string used to mark files as protected. Protected files are never cleaned up. Test this option out with `cleanup` set to false before relying on it. Protected files are printed when `cleanup` is set to true or false. Glob strings are processed by [minimatch](https://github.com/isaacs/minimatch) against remote neocities file paths. Protected files can still be updated.
7885

7986
### Outputs

action.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,32 @@ branding:
44
icon: aperture
55
color: orange
66
inputs:
7-
api_token: # api token for site to deploy to
8-
description: 'Neocities API token for site to deploy to'
7+
api_key: # api token for site to deploy to
8+
description: 'Neocities API key for site to deploy to'
99
required: true
1010
dist_dir:
1111
description: 'Local folder to deploy to neocities'
1212
default: 'public'
1313
required: true
14+
neocities_supporter:
15+
description: 'Set to true if you are a Neocities supporter to bypass file type upload restrictions'
16+
default: 'false'
17+
required: true
1418
cleanup:
1519
description: Delete orphaned files on neocities that don't exist in distDir
16-
default: false
20+
default: 'false'
1721
required: true
22+
preview_before_deploy:
23+
description: 'Set to true if you want to print deploy preview stats prior to deploying.'
24+
default: 'true'
25+
required: false
1826
protected_files:
1927
description: A glob string that prevents matched files from ever being deleted.
2028
required: false
29+
api_token: # api token for site to deploy to
30+
description: 'Neocities API key for site to deploy to'
31+
required: false
32+
deprecationMessage: 'api_token is deprecated, use api_key instead'
2133
runs:
2234
using: 'node20'
2335
main: 'dist/index.js'

0 commit comments

Comments
 (0)