See copier for details. Usage example:
Create an empty project named NewEasyProject
on GitHub
copier copy gh:/EasyScience/EasyProjectTemplate NewEasyProject # requires python>=3.9
cd NewEasyProject
git init .
git add * .copier-answers.yml .github .gitignore
git commit -m "Setup from EasyProjectTemplate"
git remote add origin [email protected]:EasyScience/NewEasyProject.git
git push origin master
Alternatively, the add remote step can be invoked using https:
git remote add origin https://github.com/EasyScience/NewEasyProject.git
Once the project is built from the template, there are manual settings to be configured per project/repository.
-
Select branch of deployed documentation. The documentation will be deployed from a branch via GitHub action. The branch of the documentation must be selected manually on GitHub. Go to
Settings > Pages
and setsource
asDeploy from a branch
andBranch
asgh-pages
. -
Enable website link on repository page. Once the branch for the documentation is selected after step
1
, it can be shown in the repository page. Go torepository page
>About section
(in the right sidebar). Click the gear and check the "Use your GitHub Pages website" checkbox for "Website".
- Create a new project by adding a trusted publisher.
- In the GitHub project settings, go to
Environments
and add a new environmentrelease
. Configure appropriate protection rules such as required reviewers and deploying only from protected branches.
Go to Settings > Branches
and in the Branch protection rules
add rule for main
branch to project it.
Under Protect matching branches
setting, select
-
Require a pull request before merging
-
Require approvals
-
Require branches to be up to date before merging
-
Require status checks to pass before merging
You can either use all checks, or select `required` checks only. The list of jobs you can select as `required` checks will be shown only after they are triggered at least once within a week.
Pre-commit hooks are scripts that are run before a commit is made to the repository.
The hooks can include code validation checks for formatting errors, test execution, and more.
Currently, the .pre-commit-config.yaml
file contains a small number of hooks related to style and mergability checks
If you want your installation to make use of the pre-commit hooks, you should create .pre-commit-config
in your new templated project,
following suggestions from the pre-commit site.