mirror of
https://github.com/bcomnes/deploy-to-neocities.git
synced 2026-01-16 22:56:28 +00:00
27 lines
681 B
JavaScript
27 lines
681 B
JavaScript
const core = require('@actions/core')
|
|
// const github = require('@actions/github')
|
|
const Neocities = require('async-neocities-tmp')
|
|
const path = require('path')
|
|
const exec = require('child_process').exec
|
|
|
|
async function doDeploy () {
|
|
const token = core.getInput('api-token')
|
|
const distDir = path.join(process.cwd(), core.getInput('dist-dir'))
|
|
const cleanup = core.getInput('cleanup')
|
|
|
|
const time = (new Date()).toTimeString()
|
|
core.setOutput('time', time)
|
|
|
|
const client = new Neocities(token)
|
|
|
|
return client.deploy(distDir, {
|
|
cleanup,
|
|
statusCb: console.log
|
|
})
|
|
}
|
|
|
|
doDeploy().then(() => {}).catch(err => {
|
|
console.error(err)
|
|
core.setFailed(err.message)
|
|
})
|