From bd88af756187bf63b3c3b3a4db4ed0a3a7ff6ce5 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Wed, 6 Sep 2023 20:40:41 +0200 Subject: [PATCH] Chore: add docs in readme --- README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 84541ec..8f0aa3c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,51 @@ # codeberg-pages-deploy -A drone plugin to deploy to codeberg pages. Basically takes a folder and pushes it to the "pages" branch in the same repo. \ No newline at end of file +A drone plugin to deploy to codeberg pages. Basically takes a folder and pushes it to the "pages" branch in the same repo. + +## Example usage + +```yaml +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Hugo + uses: https://github.com/peaceiris/actions-hugo.git@v2 + with: + hugo-version: "latest" + extended: true + + - name: Build + run: | + hugo --minify + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.21" + + - name: Deploy + uses: https://itsblue.dev/actions/codeberg-pages-deploy@v1 + with: + folder: ./public +``` + +Note: you have to either use an image which includes go or set it up before running this action. See [Creating Go Actions](https://blog.gitea.com/creating-go-actions/). + +## Options + +| parameter | description | default | +| ---------- | ----------------------------------------------------------- | --------------------------------------------- | +| folder | The folder to deploy | | +| ssh_key | The private ssh key to use if pushing to an ssh remote | empty | +| git_remote | A custom git remote to push to | the current repo | +| git_branch | The branch to push to | pages | +| token | The token/password to use if pusing to a custom http remote | the gitea-supplied token (aka `GITHUB_TOKEN`) | +| username | The username to use if pusing to a custom http remote | the actot (aka `GITHUB_ACTOR`) |