Is there a way to use a specific git branch when creating next.js project from example repo? - github

Like the title says I'm trying to create a Next.js project from a starter template repository but from a specific branch/tag, something like this:
yarn create next-app <project-name> -e https://github.com/<username>/<repo>#<branch>
But this will just create it from the main branch.
I couldn't find any examples online so perhaps I'm missing something simple or it's not possible?

Related

search for Void-Linux template in github

the package manager in Void-Linux is called xbps
To build any application by xbps, you should have a file called template
anyone can create a template that describes how to build a package automatically
some contributors store our template in github
github.com/name1/repo1/srcpkgs/vim/template
github.com/name2/repo2/srcpkgs/neovim-qt/template
github.com/name2/repo2/srcpkgs/neovide-bin/template
github.com/name2/repo2/srcpkgs/the-neovide/template
...
so my question is how can I search for it,
when I try to find the template, that does not in the official repo, like neovide,brave...
like that: neovide path=srcpkgs/*/template , I get nothing, but but this is there files for neovide in github

How do I define a GitHub action?

I'm trying to play around with GitHub actions but I'm having a hard time just have it to start.
As a first step, I have copied the following workflow on a brand new repo.
https://help.github.com/en/articles/creating-a-docker-container-action#example-using-a-private-action
But I get a parsing error
https://github.com/inforlife/action-test/blob/master/.github/main.workflow
https://raw.githubusercontent.com/inforlife/action-test/master/.github/main.workflow?token=AA3RFK7OVCNLSMBMVHK6GB25SKZRQ
Am I missing anything here?
The .github/main.workflow HCL format is GitHub Actions version 1. This version no longer works. GitHub Actions version 2 uses yaml format workflows under .github/workflows/.
Try starting with these starter workflows
https://github.com/actions/starter-workflows
You mentioned .github/main.workflow
The documentation suggests:
.github/workflows/main.yml
Adding that main.yml with .github/workflows/ should work better.

How to create github PRs from Jenkins pipeline?

I'd like to make a new git branch, add a commit, and then push to github. In addition, it would be great to create a PR for that branch straight from Jenkins job.
Has anyone done it yet? The part I'm struggling is how to create a PR. For creating a branch and commit, I'm running regular git commands in the shell.
Thanks, N.
Sounds like you want the pipeline multi branch plugin there's a blog here https://jenkins.io/blog/2015/12/03/pipeline-as-code-with-multibranch-workflows-in-jenkins/ that might help too. We use this plugin on the fabric8 project and it works great.
Correction: I misread the question initially. We use a shared pipeline library that contains reusable functions to make pull requests. This is an example where we make version update PRs on downstream repos once a release has finished. The groovy code that interacts with the github api is here

How do i manage content workflow for hexo site?

I've used static site generators like jekyll and had it hosted through github pages just fine using prose.io as a content management system.
I decided I wanted to go with a site using Hexo static site generator, but I cannot seem to figure out a good workflow for publishing content.
To my understanding this is the following in how I'd have to do it:
write *.md text file
hexo generate
(optional) hexo serve (to see local content)
hexo deploy (to publish the public content to whatever site using config.yml). Can publish on amazon S3, github pages, etc
Is there another workflow other than this?
the way I've been doing it before with jekyll+github pages is simply
go to prose.io
Write content
save (which publishes ocntent)
Ideally I'd like to use hexo+github pages the same way I do with jekyll+github pages.
Basically, can github generate static files automatically like it does with jekyll / ruby packages?
I figured out my own answer and posted it on my blog
http://www.tangycode.com/Quick-Start-Guide-To-Hexo-Install/
It covers everything you need to know on how to set up a hexo blog site and manage content workflows
One approach I am trying myself:
prose.io or similar to write and save on github repository
travis-ci.org to build hexo site and deploy
This is how it works:
Edit document on your editor of love
Commit it to your repository
travis-ci.org detects the commit and start working
My .travis.yml do (among few other things) the follow:
npm install hexo-cli
npm install grunt-cli
npm install inside site´s repository (hexo plugins and dependecies)
hexo generate
grunt deploy-production
hexo deploy (I use this to have a historic of the site stored in the repo itself)
If your editor of choice can direct commit to github repository your have exact same experience you had with Jekyll on GH pages. The advantage here is that you can use third-part plugin what GH pages avoid.
Alternatively, you can use INSTANT, which is a content management tool that you can use on any static website. You just install their javascript and can directly edit content in your website (without any admin dashboard). It saves and serves the content from the client. Pretty neat.
The easiest way is to use a hosting provider like Netlify in combination with a headless CMS, for example Headless (full disclore: I created it).
Netlify can do the build process for you and during that build process, it can fetch content from a headless CMS. Whenever you update content in the CMS, then Netlify does a rebuild.
Then you have your website on the Netlify CDN, a real CMS for your content management and you never need to dive in your code or github files. And that's all for free.

Automatically mirroring a Gitlab repo onto Github on push

I'm looking for a way to automatically mirror my Gitlab repos to Github, on push. I use Gitlab repos as my main repos, and would rather have to push to only one remote. But, I want my code to be browsable on Github also.
I found similar questions on StackOverflow, such as this one.
But the answers are always the same: one should add a custom post-receive git hook to the gitlab repo. This requires a shell access to the server running Gitlab. As I'm hosting a community edition Gitlab for many users, and not only me, they can't have easy access to a shell (and this isn't the most user-friendly way to do this), so it does not fit my needs.
I thought about two ways to implement it:
Either a MirrorOnPush project service, implementing such a git hook in Ruby, as the EmailOnPush project service currently do.
Or use a custom server to clone and push the repo, using a webhook.
The first one seems to be the cleaner to me, but I can't find any doc about Gitlab project service and code structure… On the other hand, the second is a bad and ugly hack, but is almost straightforward.
I'd rather implement a project service to handle it. Do you have any doc or leads on how to write a project service for Gitlab (without having to read all the Gitlab source code, as there seems to be no dev doc…) ?
Thanks !
one should add a custom post-receive git hook to the gitlab repo.
Actually, that was the best solution, up until 7.x GitLab, as I detailed in "Gitlab repository mirroring";
A true project service for repo mirroring is requested, but not voted up enough: suggestion: suggestion 4614663.
The main documentations remains:
the app models project services folder,
the spec models project services folder,
the doc/project_services,
the project services scenarios.
This isn't much, as the OP noted before.
Since it That leaves you with the hack approach.