diff --git a/.github/actions/dead-links/action.yml b/.github/actions/dead-links/action.yml deleted file mode 100644 index 9cf1899f..00000000 --- a/.github/actions/dead-links/action.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Dead Links -description: Run Dead Links Tests -runs: - using: "composite" - steps: - - name: Prepare Kuzzle Stack - run: | - npm ci --production=false - npm i --save-dev kuzdoc - npm run doc-prepare - npx kuzdoc iterate-repos:install --repos_path doc/framework/.repos/ - npx kuzdoc framework:link -d /sdk/dart/2/ -v 2 - shell: bash - - name: Run dead links Tests - run: | - sudo gem install typhoeus - cd doc/framework/ && HYDRA_MAX_CONCURRENCY=20 ruby .ci/dead-links.rb -p src/sdk/dart/2/ - shell: bash diff --git a/.github/actions/deploy-doc/action.yml b/.github/actions/deploy-doc/action.yml deleted file mode 100644 index 207f5a2f..00000000 --- a/.github/actions/deploy-doc/action.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Deploy Documentation -description: Build doc, upload it to S3 and invalidate Cloudfront cache - -inputs: - AWS_ACCESS_KEY_ID: - description: AWS Access key ID - required: true - AWS_SECRET_ACCESS_KEY: - description: AWS secret key - required: true - S3_BUCKET: - description: S3 bucket name - required: true - CLOUDFRONT_ID: - description: Cloudfront distribution ID - required: true - REGION: - description: AWS default region - required: true - default: "us-west-2" - FRAMEWORK_BRANCH: - description: Documentation framework branch to use - required: true - default: "master" - -runs: - using: "composite" - steps: - - name: Install AWS CLI - run: | - pip install awscli --upgrade --user - shell: bash - - name: Build documentation - run: | - rm -fr doc/framework - npm ci --production=false - npm install --save-dev kuzdoc - npm run doc-prepare - npm run doc-build - env: - NODE_ENV: production - BRANCH: ${{ inputs.FRAMEWORK_BRANCH }} - shell: bash - - name: Deploy documentation - run: | - npm run doc-upload - npm run doc-cloudfront - env: - AWS_DEFAULT_REGION: ${{ inputs.REGION }} - AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }} - S3_BUCKET: ${{ inputs.S3_BUCKET }} - CLOUDFRONT_DISTRIBUTION_ID: ${{ inputs.CLOUDFRONT_ID }} - shell: bash diff --git a/.github/workflows/pull_request.workflow.yml b/.github/workflows/pull_request.workflow.yml index 765b5a07..6f96dd9b 100644 --- a/.github/workflows/pull_request.workflow.yml +++ b/.github/workflows/pull_request.workflow.yml @@ -3,28 +3,6 @@ name: Pull request checks on: [pull_request] jobs: - # dead-links: - # name: Dead links - # runs-on: ubuntu-latest - # timeout-minutes: 30 - # steps: - # - uses: actions/checkout@v2 - # - name: Cache node modules - # uses: actions/cache@v2 - # env: - # cache-name: cache-node-modules - # with: - # path: ~/.npm - # key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-build-${{ env.cache-name }}- - # ${{ runner.os }}-build- - # ${{ runner.os }}- - # - uses: actions/setup-node@v1.4.4 - # with: - # node-version: "12" - # - uses: ./.github/actions/dead-links - doc-snippets: name: Doc Snippets runs-on: ubuntu-latest @@ -55,3 +33,26 @@ jobs: - uses: actions/checkout@v2 - uses: cedx/setup-dart@v2 - uses: ./.github/actions/tests + + doc-dead-links: + name: Check dead-links + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Extract references from context + shell: bash + id: extract-refs + run: | + echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)" + echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" + echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)" + - uses: convictional/trigger-workflow-and-wait@v1.3.0 + with: + owner: kuzzleio + repo: documentation + github_token: ${{ secrets.ACCESS_TOKEN_CI }} + workflow_file_name: dead_links.workflow.yml + ref: ${{ steps.extract-refs.outputs.fw-branch }} + inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}' diff --git a/.github/workflows/push_dev.workflow.yml b/.github/workflows/push_dev.workflow.yml index 63175d8e..a0736cb1 100644 --- a/.github/workflows/push_dev.workflow.yml +++ b/.github/workflows/push_dev.workflow.yml @@ -7,30 +7,28 @@ on: - 2-dev jobs: - dead-links: - name: Dead links + doc-dead-links: + name: Check dead-links runs-on: ubuntu-latest - timeout-minutes: 30 steps: - uses: actions/checkout@v2 - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + fetch-depth: 0 + - name: Extract references from context + shell: bash + id: extract-refs + run: | + echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)" + echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" + echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)" + - uses: convictional/trigger-workflow-and-wait@v1.3.0 with: - node-version: "12" - - uses: webfactory/ssh-agent@v0.5.2 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} - - uses: ./.github/actions/dead-links + owner: kuzzleio + repo: documentation + github_token: ${{ secrets.ACCESS_TOKEN_CI }} + workflow_file_name: dead_links.workflow.yml + ref: ${{ steps.extract-refs.outputs.fw-branch }} + inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}' doc-snippets: name: Doc Snippets @@ -63,39 +61,25 @@ jobs: - uses: cedx/setup-dart@v2 - uses: ./.github/actions/tests - doc-dev: - name: Deployment Doc Dev + doc-deploy: + name: Deploy Doc to NEXT runs-on: ubuntu-latest - timeout-minutes: 30 - # needs: [dead-links, doc-snippets, tests] - needs: [doc-snippets, tests] + needs: [doc-snippets, tests, doc-dead-links] steps: - uses: actions/checkout@v2 - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - uses: actions/setup-node@v1 with: - node-version: "12" - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - uses: ./.github/actions/deploy-doc - env: - NODE_OPTIONS: "--max_old_space_size=4096" + fetch-depth: 0 + - name: Extract references from context + shell: bash + id: extract-refs + run: | + echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)" + echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" + - uses: convictional/trigger-workflow-and-wait@v1.3.0 with: - S3_BUCKET: docs-next.kuzzle.io - CLOUDFRONT_ID: E2ZCCEK9GRB49U - REGION: us-west-2 - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - FRAMEWORK_BRANCH: develop + owner: kuzzleio + repo: documentation + github_token: ${{ secrets.ACCESS_TOKEN_CI }} + workflow_file_name: child_repo.workflow.yml + ref: develop + inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}' diff --git a/.github/workflows/push_master.workflow.yml b/.github/workflows/push_master.workflow.yml index ce50038b..e6de1357 100644 --- a/.github/workflows/push_master.workflow.yml +++ b/.github/workflows/push_master.workflow.yml @@ -7,30 +7,28 @@ on: - 1-stable jobs: - dead-links: - name: Dead links + doc-dead-links: + name: Check dead-links runs-on: ubuntu-latest - timeout-minutes: 30 steps: - uses: actions/checkout@v2 - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - uses: actions/setup-node@v1.4.4 + fetch-depth: 0 + - name: Extract references from context + shell: bash + id: extract-refs + run: | + echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)" + echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" + echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)" + - uses: convictional/trigger-workflow-and-wait@v1.3.0 with: - node-version: "12" - - uses: webfactory/ssh-agent@v0.5.2 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} - - uses: ./.github/actions/dead-links + owner: kuzzleio + repo: documentation + github_token: ${{ secrets.ACCESS_TOKEN_CI }} + workflow_file_name: dead_links.workflow.yml + ref: ${{ steps.extract-refs.outputs.fw-branch }} + inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}' doc-snippets: name: Doc Snippets @@ -63,42 +61,28 @@ jobs: - uses: cedx/setup-dart@v2 - uses: ./.github/actions/tests - doc-prod: - name: Deployment Doc Prod + doc-deploy: + name: Deploy Doc to Prod runs-on: ubuntu-latest - timeout-minutes: 30 - # needs: [dead-links, doc-snippets] - needs: [doc-snippets] + needs: [doc-snippets, tests, doc-dead-links] steps: - uses: actions/checkout@v2 - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - uses: actions/setup-node@v1 with: - node-version: "12" - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - uses: ./.github/actions/deploy-doc - env: - NODE_OPTIONS: "--max_old_space_size=4096" + fetch-depth: 0 + - name: Extract references from context + shell: bash + id: extract-refs + run: | + echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)" + echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)" + - uses: convictional/trigger-workflow-and-wait@v1.3.0 with: - FRAMEWORK_BRANCH: master - S3_BUCKET: docs.kuzzle.io - CLOUDFRONT_ID: E3D6RP0POLCJMM - REGION: us-west-2 - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + owner: kuzzleio + repo: documentation + github_token: ${{ secrets.ACCESS_TOKEN_CI }} + workflow_file_name: child_repo.workflow.yml + ref: develop + inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}' deploy-package: name: Publish Package