mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
7ee0bc4033
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | docker.io/alpine | | minor | `3.18` -> `3.19` | | docker.io/alpine | final | minor | `3.18` -> `3.19` | --- ### Configuration 📅 **Schedule**: Branch creation - "every weekend" (UTC), Automerge - "before 4am" (UTC). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/woodpecker-ci/woodpecker). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzcuOTMuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
93 lines
3 KiB
YAML
93 lines
3 KiB
YAML
version: 1
|
|
|
|
when:
|
|
- event: tag
|
|
- event: pull_request
|
|
- event: push
|
|
path: &when_path
|
|
- 'docs/**'
|
|
- '.woodpecker/docs.yml'
|
|
# since we generate docs for cli tool we have to watch this too
|
|
- 'cli/**'
|
|
- 'cmd/cli/**'
|
|
# api docs
|
|
- 'server/api/**'
|
|
branch:
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
- renovate/*
|
|
- cron: update_docs
|
|
event: cron
|
|
- event: manual
|
|
evaluate: 'TASK == "docs"'
|
|
|
|
variables:
|
|
- &golang_image 'docker.io/golang:1.21.5'
|
|
- &node_image 'docker.io/node:21-alpine'
|
|
|
|
steps:
|
|
build-cli:
|
|
image: *golang_image
|
|
commands:
|
|
- make docs
|
|
when:
|
|
- path: *when_path
|
|
- event: [cron, manual]
|
|
|
|
build:
|
|
image: *node_image
|
|
directory: docs/
|
|
commands:
|
|
- corepack enable
|
|
- pnpm install --frozen-lockfile
|
|
- pnpm build
|
|
when:
|
|
- path: *when_path
|
|
- event: [cron, manual]
|
|
|
|
deploy-preview:
|
|
image: docker.io/woodpeckerci/plugin-surge-preview:1.2.2
|
|
settings:
|
|
path: 'docs/build/'
|
|
surge_token:
|
|
from_secret: SURGE_TOKEN
|
|
forge_type: github
|
|
forge_url: 'https://github.com'
|
|
forge_repo_token:
|
|
from_secret: GITHUB_TOKEN_SURGE
|
|
failure: ignore
|
|
when:
|
|
event: pull_request
|
|
path: *when_path
|
|
|
|
# TODO: add step to remove preview again after PR is closed (waiting for #286)
|
|
|
|
deploy:
|
|
image: docker.io/alpine:3.19
|
|
secrets:
|
|
- BOT_PRIVATE_KEY
|
|
commands:
|
|
- apk add openssh-client git rsync jq
|
|
- mkdir -p $HOME/.ssh
|
|
- ssh-keyscan -t rsa github.com >> $HOME/.ssh/known_hosts
|
|
- echo "$BOT_PRIVATE_KEY" > $HOME/.ssh/id_rsa
|
|
- chmod 0600 $HOME/.ssh/id_rsa
|
|
- git config --global user.email "woodpecker-bot@obermui.de"
|
|
- git config --global user.name "woodpecker-bot"
|
|
- git clone --depth 1 --single-branch git@github.com:woodpecker-ci/woodpecker-ci.github.io.git /repo
|
|
# update latest and next version
|
|
- if [[ "$CI_PIPELINE_EVENT" == "tag" && "${CI_COMMIT_TAG}" != *"rc"* ]] ; then jq '.latest = "${CI_COMMIT_TAG}"' /repo/version.json > /repo/version.json.tmp && mv /repo/version.json.tmp /repo/version.json ; fi
|
|
- if [[ "$CI_PIPELINE_EVENT" == "tag" ]] ; then jq '.rc = "${CI_COMMIT_TAG}"' /repo/version.json > /repo/version.json.tmp && mv /repo/version.json.tmp /repo/version.json ; fi
|
|
- if [ "$CI_PIPELINE_EVENT" == "push" ] ; then jq '.next = "next-${CI_COMMIT_SHA:0:10}"' /repo/version.json > /repo/version.json.tmp && mv /repo/version.json.tmp /repo/version.json ; fi
|
|
# copy all docs files and delete all old ones, but leave CNAME and index.yaml untouched
|
|
- rsync -r --exclude .git --exclude CNAME --exclude index.yaml --exclude README.md --exclude version.json --delete docs/build/ /repo
|
|
- cd /repo
|
|
- git add .
|
|
# exit successfully if nothing changed
|
|
- test -n "$(git status --porcelain)" || exit 0
|
|
- git commit -m "Deploy website - based on ${CI_COMMIT_SHA}"
|
|
- git push
|
|
when:
|
|
- event: push
|
|
path: *when_path
|
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
- event: [cron, manual, tag]
|