From a4c13af578105ffbce78645ec0c824e0f9525e12 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 30 Apr 2023 12:23:26 -0400 Subject: [PATCH] Move docs pipelines to use Actions (#24434) similar to #24314, this moves drone cron pipelines to (GitHub) Actions. As these are mostly compatible with Gitea Actions, when we start to dogfood, these will already be migrated. I also removed the discord notify pipeline, as it hasn't been working for several months. --- .drone.yml | 126 --------------------- .github/workflows/pull-compliance_docs.yml | 22 ++++ .github/workflows/push-publish_docs.yml | 31 +++++ 3 files changed, 53 insertions(+), 126 deletions(-) create mode 100644 .github/workflows/pull-compliance_docs.yml create mode 100644 .github/workflows/push-publish_docs.yml diff --git a/.drone.yml b/.drone.yml index 5096ce781..197ee131f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -267,35 +267,6 @@ steps: - name: deps path: /go ---- -kind: pipeline -type: docker -name: compliance-docs - -platform: - os: linux - arch: amd64 - -trigger: - event: - - pull_request - paths: - include: - - "docs/**" - - "*.md" - -steps: - - name: deps-frontend - image: node:18 - pull: always - commands: - - make deps-frontend - - - name: lint-md - image: node:18 - commands: - - make lint-md - --- kind: pipeline type: docker @@ -1033,49 +1004,6 @@ steps: from_secret: github_token depends_on: [gpg-sign] ---- -kind: pipeline -type: docker -name: docs - -platform: - os: linux - arch: arm64 - -depends_on: - - compliance - -trigger: - event: - - push - - tag - - pull_request - paths: - include: - - "docs/**" - -steps: - - name: build-docs - image: gitea/test_env:linux-1.20-arm64 - commands: - - cd docs - - make trans-copy clean build - - - name: publish-docs - image: techknowlogick/drone-netlify:latest - pull: always - settings: - path: docs/public/ - site_id: d2260bae-7861-4c02-8646-8f6440b12672 - environment: - NETLIFY_TOKEN: - from_secret: netlify_token - when: - branch: - - main - event: - - push - --- kind: pipeline type: docker @@ -1818,57 +1746,3 @@ depends_on: - docker-linux-arm64-release - docker-linux-amd64-release-branch - docker-linux-arm64-release-branch - ---- -kind: pipeline -type: docker -name: notifications - -platform: - os: linux - arch: arm64 - -clone: - disable: true - -trigger: - branch: - - main - - "release/*" - event: - - push - - tag - status: - - success - - failure - -depends_on: - - testing-mysql - - testing-mysql8 - - testing-mssql - - testing-pgsql - - testing-sqlite - - release-version - - release-latest - - docker-linux-amd64-release - - docker-linux-arm64-release - - docker-linux-amd64-release-version - - docker-linux-arm64-release-version - - docker-linux-amd64-release-candidate-version - - docker-linux-arm64-release-candidate-version - - docker-linux-amd64-release-branch - - docker-linux-arm64-release-branch - - docker-manifest - - docker-manifest-version - - docs - -steps: - - name: discord - image: appleboy/drone-discord:1.2.4 - pull: always - settings: - message: "{{#success build.status}} āœ… Build #{{build.number}} of `{{repo.name}}` succeeded.\n\nšŸ“ Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\nšŸŒ {{ build.link }} {{else}} āŒ Build #{{build.number}} of `{{repo.name}}` failed.\n\nšŸ“ Commit by {{commit.author}} on `{{commit.branch}}`:\n``` {{commit.message}} ```\n\nšŸŒ {{ build.link }} {{/success}}\n" - webhook_id: - from_secret: discord_webhook_id - webhook_token: - from_secret: discord_webhook_token diff --git a/.github/workflows/pull-compliance_docs.yml b/.github/workflows/pull-compliance_docs.yml new file mode 100644 index 000000000..e3c3a4254 --- /dev/null +++ b/.github/workflows/pull-compliance_docs.yml @@ -0,0 +1,22 @@ +name: Compliance testing for documentation + +on: + pull_request: + paths: + - "docs/**" + - "*.md" + +jobs: + compliance-docs: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup node + uses: actions/setup-node@v2 + with: + node-version: 18 + - name: install dependencies + run: make deps-frontend + - name: lint markdown + run: make lint-md diff --git a/.github/workflows/push-publish_docs.yml b/.github/workflows/push-publish_docs.yml new file mode 100644 index 000000000..6658830db --- /dev/null +++ b/.github/workflows/push-publish_docs.yml @@ -0,0 +1,31 @@ +name: Publish documentation + +on: + push: + paths: + - "docs/**" + branch: + - main + +jobs: + compliance-docs: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup go + uses: actions/setup-go@v4 + with: + go-version: '>=1.20.1' + - name: build docs + run: | + cd docs + make trans-copy clean build + - name: publish to netlify + uses: nwtgck/actions-netlify@v2.0 + with: + production-branch: main + publish-dir: docs/public/ + site-id: d2260bae-7861-4c02-8646-8f6440b12672 + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}