diff --git a/.drone.star b/.drone.star deleted file mode 100644 index 163d75f..0000000 --- a/.drone.star +++ /dev/null @@ -1,246 +0,0 @@ -def main(ctx): - # Config - - environment = "android" - - # Version shown as latest in generated documentations - # It's fine that this is out of date in version branches, usually just needs - # adjustment in master/deployment_branch when a new version is added to site.yml - latest_version = "4.7" - default_branch = "master" - - # Current version branch (used to determine when changes are supposed to be pushed) - # pushes to base_branch will trigger a build in deployment_branch but pushing - # to fix-typo branch won't - base_branch = latest_version - - # Version branches never deploy themselves, but instead trigger a deployment in deployment_branch - # This must not be changed in version branches - deployment_branch = default_branch - pdf_branch = default_branch - - # Environment variables needed to generate the search index are only provided in the docs repo in .drone.star - # Also see the documentation for more details. - - return [ - checkStarlark(), - build(ctx, environment, latest_version, deployment_branch, base_branch, pdf_branch), - trigger(ctx, environment, latest_version, deployment_branch, base_branch, pdf_branch), - ] - -def checkStarlark(): - return { - "kind": "pipeline", - "type": "docker", - "name": "check-starlark", - "steps": [ - { - "name": "format-check-starlark", - "image": "owncloudci/bazel-buildifier", - "pull": "always", - "commands": [ - "buildifier --mode=check .drone.star", - ], - }, - { - "name": "show-diff", - "image": "owncloudci/bazel-buildifier", - "pull": "always", - "commands": [ - "buildifier --mode=fix .drone.star", - "git diff", - ], - "when": { - "status": [ - "failure", - ], - }, - }, - ], - "depends_on": [], - "trigger": { - "ref": [ - "refs/pull/**", - ], - }, - } - -def build(ctx, environment, latest_version, deployment_branch, base_branch, pdf_branch): - return { - "kind": "pipeline", - "type": "docker", - "name": "documentation", - "platform": { - "os": "linux", - "arch": "amd64", - }, - "steps": [ - { - "name": "cache-restore", - "pull": "always", - "image": "plugins/s3-cache:1", - "settings": { - "endpoint": from_secret("cache_s3_server"), - "access_key": from_secret("cache_s3_access_key"), - "secret_key": from_secret("cache_s3_secret_key"), - "restore": "true", - }, - }, - { - "name": "docs-deps", - "pull": "always", - "image": "owncloudci/nodejs:22", - "commands": [ - "npm install", - ], - }, - { - "name": "docs-build", - "pull": "always", - "image": "owncloudci/nodejs:22", - "commands": [ - "npm run antora", - ], - }, - { - "name": "cache-rebuild", - "pull": "always", - "image": "plugins/s3-cache:1", - "settings": { - "endpoint": from_secret("cache_s3_server"), - "access_key": from_secret("cache_s3_access_key"), - "secret_key": from_secret("cache_s3_secret_key"), - "rebuild": "true", - "mount": [ - "node_modules", - ], - }, - "when": { - "event": [ - "push", - "cron", - ], - "branch": [ - deployment_branch, - base_branch, - ], - }, - }, - { - "name": "cache-flush", - "pull": "always", - "image": "plugins/s3-cache:1", - "settings": { - "endpoint": from_secret("cache_s3_server"), - "access_key": from_secret("cache_s3_access_key"), - "secret_key": from_secret("cache_s3_secret_key"), - "flush": "true", - "flush_age": "14", - }, - "when": { - "event": [ - "push", - "cron", - ], - }, - }, - # we keep uploading pdf for future reenabling - #{ - # "name": "upload-pdf", - # "pull": "always", - # "image": "plugins/s3-sync", - # "settings": { - # "bucket": "uploads", - # "endpoint": from_secret("docs_s3_server"), - # "access_key": from_secret("docs_s3_access_key"), - # "secret_key": from_secret("docs_s3_secret_key"), - # "path_style": "true", - # "source": "pdf_web/", - # "target": "/pdf/%s" % environment, - # }, - # "when": { - # "event": [ - # "push", - # "cron", - # ], - # "branch": [ - # pdf_branch, - # ], - # }, - #}, - { - "name": "notify", - "pull": "if-not-exists", - "image": "plugins/slack", - "settings": { - "webhook": from_secret("rocketchat_talk_webhook"), - "channel": "builds", - }, - "when": { - "event": [ - "push", - "cron", - ], - "status": [ - "failure", - ], - }, - }, - ], - "depends_on": [ - "check-starlark", - ], - "trigger": { - "ref": { - "include": [ - "refs/heads/%s" % deployment_branch, - "refs/heads/%s" % pdf_branch, - "refs/tags/**", - "refs/pull/**", - ], - }, - }, - } - -def trigger(ctx, environment, latest_version, deployment_branch, base_branch, pdf_branch): - return { - "kind": "pipeline", - "type": "docker", - "name": "trigger", - "platform": { - "os": "linux", - "arch": "amd64", - }, - "clone": { - "disable": True, - }, - "steps": [ - { - "name": "trigger-docs", - "pull": "always", - "image": "plugins/downstream", - "settings": { - "server": "https://drone.owncloud.com", - "token": from_secret("drone_token"), - "fork": "true", - "repositories": [ - "owncloud/docs@master", - ], - }, - }, - ], - "depends_on": [ - "documentation", - ], - "trigger": { - "ref": [ - "refs/heads/%s" % deployment_branch, - "refs/heads/%s" % base_branch, - ], - }, - } - -def from_secret(name): - return { - "from_secret": name, - } diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 953aa45..7926bb6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,10 @@ version: 2 updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 - package-ecosystem: npm directory: "/" schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..78e942d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: + - master + - '10.16' + tags: + - '**' + pull_request: + branches: + - master + +jobs: + docs-build: + name: Build documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version: '22' + + - name: Install dependencies + run: npm install + + - name: Build documentation + run: npm run antora + + trigger-docs: + name: Trigger docs build + runs-on: ubuntu-latest + needs: docs-build + if: | + github.event_name == 'push' && + (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/10.16') + steps: + - uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0 + with: + token: ${{ secrets.DOCS_TRIGGER_TOKEN }} + repository: owncloud/docs + event-type: docs-rebuild diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 0000000..ee7e019 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,16 @@ +name: Lint PR title + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}