D
D
dinlike2022-03-13 20:16:14
git
dinlike, 2022-03-13 20:16:14

How to upload a built project to GitHub using gulp?

I'm just starting to learn gulp, so there are some difficulties.
I can't find on the internet how to solve this problem.

The bottom line is that I have an assembly that collects the final build in a folder, but I don’t understand how to make a task that will upload this build to GH.
I know that this can also be done through GIT, but my task is to make a script that would upload a new build to GH itself.

I found "gulp-gh-pages" but can't figure out how to set it up to link with GH.

How I do:
1. in the github.js file

import git from "gulp-gh-pages";

export const github = () => {
  return app.gulp
    .src(`${app.path.build}/**/*.*`)
    .pipe(git());
};


2. in gulpfile.js
import { github } from "./gulp/tasks/github.js";
const deployGitHub = gulp.series(reset(очистка), mainTasks(сборка), github);
export { deployGitHub }


3. in package.json file
"scripts": {
    "deployGitHub": "gulp deployGitHub",
  },


As a result, the script works, but there are no changes on GH ...
I'm sure that I'm doing something wrong, tell me, please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Goretsky, 2022-03-13
@rqdkmndh

Look at the date of publication (update) of the gulp-gh-pages package 6 years (4 years) - during this time, two-factor authorization was introduced on GIT and the old (weakly protected) methods for authorization and deployment were disabled. Look for more recent solutions. And use tokens for deployment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question