mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-16 22:56:28 +00:00
checking in
This commit is contained in:
parent
09bae6fac3
commit
7e95fe7e68
26
.github/workflows/example.yml
vendored
26
.github/workflows/example.yml
vendored
@ -3,27 +3,29 @@ name: Example usage
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
example:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [12.x]
|
os: [ubuntu-latest]
|
||||||
|
node: [12]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node }}
|
||||||
- run: sudo apt-get install xvfb
|
- name: npm install and build
|
||||||
- name: npm install, build, and test
|
|
||||||
run: |
|
run: |
|
||||||
npm i
|
npm i
|
||||||
xvfb-run --auto-servernum node example.js
|
npm run build
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
- name: Cleanup xvfb pidx
|
- name: Deploy to neocities
|
||||||
uses: bcomnes/cleanup-xvfb@v1
|
uses: bcomnes/deploy-to-neocities@master
|
||||||
|
with:
|
||||||
|
api-token: ${{ secrets.NeocitiesToken }}
|
||||||
|
distDir: public
|
||||||
|
cleanup: true
|
||||||
|
|||||||
10
action.yml
10
action.yml
@ -7,7 +7,15 @@ inputs:
|
|||||||
api-token: # api token for site to deploy to
|
api-token: # api token for site to deploy to
|
||||||
description: 'Neocities API token for site to deploy to'
|
description: 'Neocities API token for site to deploy to'
|
||||||
required: true
|
required: true
|
||||||
|
distDir:
|
||||||
|
description: 'Local folder to deploy to neocities'
|
||||||
|
default: 'public'
|
||||||
|
required: true
|
||||||
|
cleanup:
|
||||||
|
description: Delete orphaned files on neocities that don't exist in distDir
|
||||||
|
default: false
|
||||||
|
required: true
|
||||||
outputs: # none
|
outputs: # none
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'dist/bundle.cjs.js'
|
main: 'index.js'
|
||||||
|
|||||||
BIN
fixtures/cat.png
BIN
fixtures/cat.png
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 461 B |
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 KiB |
37
index.js
37
index.js
@ -1,4 +1,37 @@
|
|||||||
|
const core = require('@actions/core')
|
||||||
|
// const github = require('@actions/github')
|
||||||
|
// const Neocities = require('async-neocities')
|
||||||
|
const path = require('path')
|
||||||
|
const exec = require('child_process').exec
|
||||||
|
|
||||||
const { NeocitiesAPIClient } = require('./lib/client.js')
|
async function doDeploy () {
|
||||||
|
// `who-to-greet` input defined in action metadata file
|
||||||
|
const token = core.getInput('api-token')
|
||||||
|
const distDir = core.getInput('dist-dir')
|
||||||
|
const cleanup = core.getInput('cleanup')
|
||||||
|
|
||||||
module.exports = { NeocitiesAPIClient }
|
const time = (new Date()).toTimeString()
|
||||||
|
core.setOutput('time', time)
|
||||||
|
|
||||||
|
const client = new Neocities(token)
|
||||||
|
|
||||||
|
console.log(process.cwd())
|
||||||
|
console.log(path.join(process.cwd(), distDir))
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
exec('ls -la', (error, stdout, stderr) => {
|
||||||
|
console.log(stdout)
|
||||||
|
console.log(stderr)
|
||||||
|
if (error !== null) {
|
||||||
|
console.log(`exec error: ${error}`)
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// return client.deploy()
|
||||||
|
}
|
||||||
|
|
||||||
|
doDeploy.then(() => {}).catch(err => {
|
||||||
|
core.setFailed(err.message)
|
||||||
|
})
|
||||||
|
|||||||
14
package.json
14
package.json
@ -23,23 +23,15 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
|
"homepage": "https://github.com/bcomnes/deploy-to-neocities#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"builtin-modules": "^3.1.0",
|
|
||||||
"dependency-check": "^4.1.0",
|
"dependency-check": "^4.1.0",
|
||||||
"mkdirp": "^0.5.1",
|
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"rimraf": "^3.0.0",
|
|
||||||
"standard": "^14.3.1",
|
"standard": "^14.3.1",
|
||||||
"tap": "^14.10.5"
|
"tap": "^14.10.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.2",
|
||||||
"@actions/github": "^1.1.0",
|
"@actions/github": "^2.1.0",
|
||||||
"async-folder-walker": "^2.0.0",
|
"async-neocities-tmp": "0.0.2"
|
||||||
"fetch-errors": "^1.0.1",
|
|
||||||
"form-data": "^3.0.0",
|
|
||||||
"nanoassert": "^2.0.0",
|
|
||||||
"pump": "^3.0.0",
|
|
||||||
"qs": "^6.9.1"
|
|
||||||
},
|
},
|
||||||
"standard": {
|
"standard": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user