Compare commits
No commits in common. "53f5a6952bdfd2d72697f6953e8a578dac91943e" and "510e60a42ea77c7a422197886b9cc0f8318ddc02" have entirely different histories.
53f5a6952b
...
510e60a42e
35
README.md
35
README.md
@ -1,35 +0,0 @@
|
||||
# woodpecker-ssg-deploy
|
||||
|
||||
A Woodpecker plugin to push outputs created by SSGs into git repositories.
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
deploy:
|
||||
image: git.polynom.me/papatutuwawa/woodpecker-ssg-deploy:latest
|
||||
# The push token
|
||||
# NOTE: For gitea, this is currently an access token with Read/Write access
|
||||
# to repositories.
|
||||
secrets: [ token ]
|
||||
settings:
|
||||
# The EMail to use for the git user that does the pushing
|
||||
email: "system@example.org"
|
||||
# The name to use for the git user that does the pushing
|
||||
name: "example.org CI System"
|
||||
# The name of the environment variable that contains the push token
|
||||
token_env: "TOKEN"
|
||||
# The name of the directory containing the SSG output
|
||||
output: "public"
|
||||
# The name of the branch to push into. Defaults to "pages"
|
||||
branch: "pages"
|
||||
```
|
||||
|
||||
What the plugin does is initialize a new Git repository in the output directory,
|
||||
add all files in the output directory to the repository and then force push to the original
|
||||
repository on the specified branch.
|
||||
|
||||
For a real-life example [see here](https://git.polynom.me/PapaTutuWawa/blog.polynom.me).
|
||||
|
||||
## License
|
||||
|
||||
See `LICENSE`.
|
@ -2,10 +2,8 @@
|
||||
branch=${PLUGIN_BRANCH:-"pages"}
|
||||
token_env=${PLUGIN_TOKEN_ENV}
|
||||
output=${PLUGIN_OUTPUT}
|
||||
name=${PLUGIN_NAME}
|
||||
email=${PLUGIN_EMAIL}
|
||||
if [[ -z "$token_env" ]] || [[ -z "$branch" ]] || [[ -z "$name"]] || [[ -z "$email" ]]; then
|
||||
echo "Invalid configuration: Token environment variable name, branch name empty, name, or email"
|
||||
if [[ -z "$token_env" ]] || [[ -z "$branch" ]]; then
|
||||
echo "Invalid configuration: Token environment variable name or branch name empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -15,8 +13,8 @@ if [[ "$?" -ne "0" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git config --global user.email "$email"
|
||||
git config --global user.name "$name"
|
||||
[[ -n "$PLUGIN_EMAIL" ]] && git config --config user.email "$PLUGIN_EMAIL"
|
||||
[[ -n "$PLUGIN_NAME" ]] && git config --config user.name "$PLUGIN_NAME"
|
||||
git config --global --add safe.directory "$CI_WORKSPACE/$CI_REPO_OWNER/$CI_REPO_NAME/$output"
|
||||
|
||||
# Init a new repository in the output directory and add all files
|
||||
|
Loading…
Reference in New Issue
Block a user