diff --git a/.github/workflows/deploy-to-keycdn-master.yaml b/.github/workflows/deploy-to-keycdn-master.yaml new file mode 100644 index 000000000..4c34d4ecb --- /dev/null +++ b/.github/workflows/deploy-to-keycdn-master.yaml @@ -0,0 +1,44 @@ +on: + push: + branches: + - master +name: Deploy to KeyCDN +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get Version + id: get-version + uses: beaconbrigade/package-json-version@v0.3.2 + with: + path: . + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Push files to Current folder + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ftp.keycdn.com + username: metro4 + password: ${{ secrets.FTP_PASSWORD_KEYCDN }} + dangerous-clean-slate: true + local-dir: ./lib/ + server-dir: current/ + + - name: Push files to Number folder + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ftp.keycdn.com + username: metro4 + password: ${{ secrets.FTP_PASSWORD_KEYCDN }} + dangerous-clean-slate: true + local-dir: ./lib/ + server-dir: ${{ steps.get-version.outputs.version }}/ diff --git a/deploy-dev.js b/deploy-dev.js deleted file mode 100644 index fe8674974..000000000 --- a/deploy-dev.js +++ /dev/null @@ -1,31 +0,0 @@ -import FtpDeploy from "ftp-deploy" -import auth from "./ftpauth.json" with {type: "json"} -import { dirname } from 'path'; -import { fileURLToPath } from 'url'; - -const __dirname = dirname(fileURLToPath(import.meta.url)); - -const ftpDeploy = new FtpDeploy(); - -const config = { - user: auth.keycdn.username, - password: auth.keycdn.password, - host: auth.keycdn.host, - port: auth.keycdn.port, - localRoot: __dirname + "/lib", - remoteRoot: `/dev/`, - include: ["*.*"], - exclude: [], - deleteRemote: true, - forcePasv: true, - sftp: false, -}; - -ftpDeploy.on("uploading", function (data) { - console.log(data.filename); // partial path with filename being uploaded -}); - -ftpDeploy - .deploy(config) - .then((res) => console.log("Deploy finished")) - .catch((err) => console.log(err)); diff --git a/package.json b/package.json index dc6dfee1a..cf188bc3e 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,9 @@ "build": "npm run clean && cross-env NODE_NO_WARNINGS=1 MODE=production node build.js", "dev": "npm run clean && cross-env NODE_NO_WARNINGS=1 MODE=development node build.js", "watch": "npm run clean && cross-env NODE_NO_WARNINGS=1 MODE=development node watch.js", - "dep:prod": "npm run build && node ./deploy.js", - "dep": "npm run dev && node ./deploy-dev.js", + "dep": "npm run build && node ./deploy.js", "pub": "npm publish --access public", - "test": "easytest --include='__tests__/*.test.js' --skip='gravatar,touch,sidebar,list.html,audio-player'", + "test": "easytest --include='__tests__/*.test.js'", "check": "npx biome check" }, "browserslist": ["last 2 versions"],