Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic deployment preview of PRs when changing the site #660

Merged
merged 1 commit into from
Oct 19, 2021

Conversation

jkremser
Copy link
Member

This is basically #657 + #658 combined to just one (no need to have a makefile target on the gh-pages branch if it's done in the bash script)

Signed-off-by: Jirka Kremser jiri.kremser@gmail.com

@somaritane
Copy link
Contributor

@jkremser, it would have been better to just leave #658 open and not create a new PR in order to keep the context.

netlify.toml Outdated
@@ -0,0 +1,7 @@
[build]
command = "./.netlify.sh"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it also run make target so we can put contents of .netlifty.sh into the Makefile?

Copy link
Member Author

@jkremser jkremser Oct 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half of them yes, but these:

    if ! git config remote.origin.url &> /dev/null; then
        git remote add -f -t gh-pages origin https://github.com/k8gb-io/k8gb
    fi
    git fetch origin gh-pages:gh-pages
    git checkout gh-pages

must be done on the ref representing the PR which is checked out by default. If I split the commands into those that must be present in the netlify.toml on a pr branch and those that can be stored in the gh-pages' Makefile, I'd end up basically w/ the two original PRs, lol

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original PR was using Makefile on gh-pages, meanwhile I suggest to use standard Makefile at https://github.com/k8gb-io/k8gb/blob/master/Makefile

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got ya, yes, Netlify env. can run make targets... if we put the content of the bash script to the main Makefile (that 1 on the master's branch), that should work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done using the Makefile target @ master

Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
@jkremser jkremser merged commit d6364a2 into k8gb-io:master Oct 19, 2021
@jkremser jkremser deleted the site-preview branch October 19, 2021 10:05
@somaritane somaritane added this to the 0.9 milestone Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants