feat: add website

This commit is contained in:
Bret Comnes 2020-02-18 11:12:16 -07:00
parent 31484af044
commit 648ade5fef
No known key found for this signature in database
GPG Key ID: 3705F4634DC3A1AC
7 changed files with 65 additions and 40 deletions

31
.github/workflows/neocities.yml vendored Normal file
View 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

View File

@ -1,6 +1,8 @@
# deploy-to-neocities
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/bcomnes/deploy-to-neocities)](https://github.com/bcomnes/deploy-to-neocities)
[![Actions Status](https://github.com/bcomnes/deploy-to-neocities/workflows/tests/badge.svg)](https://github.com/bcomnes/deploy-to-neocities/actions)
[![Marketplace link](https://img.shields.io/badge/github%20marketplace-deploy--to--neocities-brightgreen)](https://github.com/marketplace/actions/deploy-to-neocities)
<center><img src="logo.png"></center>
@ -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

View File

@ -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
View 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>

View File

@ -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,6 +36,8 @@
"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",
@ -38,11 +47,7 @@
"@actions/core": "1.2.2",
"async-neocities": "1.1.6",
"ms": "^2.1.2",
"nanoassert": "^2.0.0"
},
"standard": {
"ignore": [
"dist"
]
"nanoassert": "^2.0.0",
"sitedown": "^4.0.0"
}
}

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 110 KiB