From 648ade5fef90e498638f7c584e7ee504641db809 Mon Sep 17 00:00:00 2001 From: Bret Comnes Date: Tue, 18 Feb 2020 11:12:16 -0700 Subject: [PATCH] feat: add website --- .github/workflows/neocities.yml | 31 +++++++++++++++++++++++++++++++ README.md | 7 ++++++- example.yml | 31 ------------------------------- layout.html | 15 +++++++++++++++ package.json | 21 +++++++++++++-------- static/favicon.ico | Bin 0 -> 5430 bytes logo.png => static/logo.png | Bin 7 files changed, 65 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/neocities.yml delete mode 100644 example.yml create mode 100644 layout.html create mode 100644 static/favicon.ico rename logo.png => static/logo.png (100%) diff --git a/.github/workflows/neocities.yml b/.github/workflows/neocities.yml new file mode 100644 index 0000000..f40c284 --- /dev/null +++ b/.github/workflows/neocities.yml @@ -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 diff --git a/README.md b/README.md index 2f20ac7..e70b2e3 100644 --- a/README.md +++ b/README.md @@ -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)
@@ -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 diff --git a/example.yml b/example.yml deleted file mode 100644 index 34dce59..0000000 --- a/example.yml +++ /dev/null @@ -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 diff --git a/layout.html b/layout.html new file mode 100644 index 0000000..3661509 --- /dev/null +++ b/layout.html @@ -0,0 +1,15 @@ + + + + + Deploy to Neocities + + + + + + + +
+ + diff --git a/package.json b/package.json index 1ad1180..bfa605c 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2120c91605df63be79b31279823b1d779a82c2c8 GIT binary patch literal 5430 zcmd5=3viUx72Zc)YgiKUATN?EglyiB1ffVy)gDyB&$H$_3#z&{KO3mVYFJt@bY)j^=h)AGx$B!Vov)$f`(1Sl$i@Kciw#DJU$kFJwmQaKQYi# zPwH%2s?!@F=##qvS#LDq#bd2#Z*NCoVId|?oQP9@y9(=~{SLp77#rpDH5;rC<|ys` zo-IepiqlA3au^xgnlOD`Ife}zhKPrzAkwq|m6cV-CFG@mWe<(~~mx=S485&T@?>gvywTDrr_ATg#3g@lc>1o@C5Cf8 zXu+U2o$=7xrHuPU34&t!pAh~2i{EP*xb?cD_n4(^k>gj`tuGvFOaE29n!^E%m&DOi zSL#7oV-eNIGK=~(aWi&0f-*+6u>KAqYqo-MtuvW}u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