B
B
BigSmoke2019-01-11 11:31:40
GitHub
BigSmoke, 2019-01-11 11:31:40

How to put a project on username.github.io?

I have a project with the following structure:
5c385263b7b2e948545089.jpeg
As far as I understand, all files and folders, except for node_modules and .git, should be in the same branch (let it be dev), and the contents of the dist folder (here is the index.html file) should be in the master. But I don't really understand how I can send the contents of dist to master after making changes in the dev branch. How is it usually done?
upd. Some solution was offered, but it's not quite what you need. If someone knows how to do it correctly - write in the answers, I will mark the solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2019-01-11
@BigSmoke

old version
Как вариант, могу предложить следующее.
Создать новый репозиторий и первым коммитом сделать пустой коммит, для того чтобы можно было в разных ветках хранить разные файлы:
дальше в ветку dev коммитите исходники, а в ветку master файлы из директории dist
Almost a year after answering this question, I stumbled upon a very interesting way using git submodules.
https://gohugo.io/hosting-and-deployment/hosting-o...
The essence of the method:
Make the dist directory a submodule that leads to your site repository (the site code itself is stored in a separate repository)
After that, the site is uploaded/updated like this:
# Build the project.
yarn build
# npm run build

# Go To dist folder
cd dist

# Add changes to git.
git add .

# Commit changes.
git commit -m "rebuilding site $(date)"

# Push source and build repos.
git push origin master

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question