Adds a publish button to Nova to trigger a GitHub workflow which runs you static site generator
Developed with ❤️ by GRRR
- PHP 7.4
- GitHub Actions workflow
Add the repository to composer.json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/grrr-amsterdam/nova-publish"
}
]
Add install the package
composer require grrr-amsterdam/nova-publish
Load the tool by adding it to NovaServiceProvider.php
use Publish\Publish;
public function tools()
{
return [new Publish()];
}
Publish configuration
php artisan vendor:publish --provider="Publish\ToolServiceProvider"
Configure GitHub credentials, set the path to the workflow file and configure an application version.
Personal Access Tokens (PATs) are currently the only way to access the GitHub API. The token is created by a GitHub user. So when this user is removed from the GitHub organization the token must be recreated by another user. Not ideal, so there is room for improvement.
Create a Personal Access Token: https://github.com/settings/tokens
- Note: the name of the project
- Expiration: No expiration (or you have to replace the token every time it expires)
- Scopes: "repo" and "workflow"
Add the created token as environment variable PUBLISH_GITHUB_PERSONAL_ACCESS_TOKEN
.
You GitHub username must be stored in PUBLISH_GITHUB_USERNAME
.
You need a Nova license to run the tests.