mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-16 22:56:28 +00:00
feat: add website
This commit is contained in:
parent
31484af044
commit
648ade5fef
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@v1
|
||||||
|
with:
|
||||||
|
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
|
||||||
|
cleanup: false
|
||||||
|
dist_dir: public
|
||||||
@ -1,6 +1,8 @@
|
|||||||
# deploy-to-neocities
|
# deploy-to-neocities
|
||||||
|
|
||||||
|
[](https://github.com/bcomnes/deploy-to-neocities)
|
||||||
[](https://github.com/bcomnes/deploy-to-neocities/actions)
|
[](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="logo.png"></center>
|
||||||
|
|
||||||
@ -42,6 +44,9 @@ jobs:
|
|||||||
dist_dir: public
|
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).
|
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`.
|
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`.
|
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
|
### 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
|
|
||||||
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>
|
||||||
21
package.json
21
package.json
@ -13,8 +13,15 @@
|
|||||||
"version:1-changelog": "auto-changelog -p --template keepachangelog auto-changelog --breaking-pattern 'BREAKING:' && git add CHANGELOG.md",
|
"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",
|
"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",
|
"postversion": "rm -rf node_modules && mv tmp_modules node_modules",
|
||||||
"clean": "rimraf dist && mkdirp dist",
|
"clean": "rimraf public && mkdirp public",
|
||||||
"build": "mkdir public && cp package.json public/test.json"
|
"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": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -29,6 +36,8 @@
|
|||||||
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
|
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"auto-changelog": "^1.16.2",
|
"auto-changelog": "^1.16.2",
|
||||||
|
"budo": "^11.6.3",
|
||||||
|
"cpx2": "^2.0.0",
|
||||||
"dependency-check": "^4.1.0",
|
"dependency-check": "^4.1.0",
|
||||||
"gh-release": "^3.5.0",
|
"gh-release": "^3.5.0",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
@ -38,11 +47,7 @@
|
|||||||
"@actions/core": "1.2.2",
|
"@actions/core": "1.2.2",
|
||||||
"async-neocities": "1.1.6",
|
"async-neocities": "1.1.6",
|
||||||
"ms": "^2.1.2",
|
"ms": "^2.1.2",
|
||||||
"nanoassert": "^2.0.0"
|
"nanoassert": "^2.0.0",
|
||||||
},
|
"sitedown": "^4.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 |
Loading…
x
Reference in New Issue
Block a user