diff --git a/.github/workflows/add-untriaged.yml b/.github/workflows/add-untriaged.yml deleted file mode 100644 index 9dcc7020d2..0000000000 --- a/.github/workflows/add-untriaged.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Apply 'untriaged' label during issue lifecycle - -on: - issues: - types: [opened, reopened, transferred] - -jobs: - apply-label: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['untriaged'] - }) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 8f933b2ada..0000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Backport -on: - pull_request_target: - types: - - closed - - labeled - -jobs: - backport: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - name: Backport - # Only react to merged PRs for security reasons. - # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. - if: > - github.event.pull_request.merged - && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport') - ) - ) - steps: - - name: GitHub App token - id: github_app_token - uses: tibdex/github-app-token@v1.5.0 - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - # opensearch-trigger-bot installation ID - installation_id: 22958780 - - - name: Backport - uses: VachaShah/backport@v2.1.0 - with: - github_token: ${{ steps.github_app_token.outputs.token }} - head_template: backport/backport-<%= number %>-to-<%= base %> diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml deleted file mode 100644 index 387a124b8c..0000000000 --- a/.github/workflows/delete_backport_branch.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Delete merged branch of the backport PRs -on: - pull_request: - types: - - closed - -jobs: - delete-branch: - runs-on: ubuntu-latest - if: startsWith(github.event.pull_request.head.ref,'backport/') - steps: - - name: Delete merged branch - uses: SvanBoxel/delete-merged-branch@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/jekyll-build.yml b/.github/workflows/jekyll-build.yml deleted file mode 100644 index e70385484e..0000000000 --- a/.github/workflows/jekyll-build.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Jekyll Build Verification - -on: [pull_request] - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0' - bundler-cache: true - - run: | - JEKYLL_FATAL_LINK_CHECKER=internal bundle exec jekyll build --future diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml deleted file mode 100644 index 2e8c63a888..0000000000 --- a/.github/workflows/link-checker.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Check Links -on: - workflow_dispatch: - schedule: - - cron: "30 11 * * 0" -jobs: - check: - if: github.repository == 'opensearch-project/documentation-website' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0' - bundler-cache: true - - run: | - JEKYLL_FATAL_LINK_CHECKER=all bundle exec jekyll build --future - - name: Create Issue On Build Failure - if: ${{ failure() }} - uses: dblock/create-a-github-issue@v3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - with: - update_existing: true - filename: .github/ISSUE_TEMPLATE/broken_links.md diff --git a/.github/workflows/publish_site.yml b/.github/workflows/publish_site.yml new file mode 100644 index 0000000000..71fa8a0bb5 --- /dev/null +++ b/.github/workflows/publish_site.yml @@ -0,0 +1,95 @@ +name: Publish Website eoed-docs.eliatra.com + +on: + workflow_dispatch: + push: + - 2.11.x-ee + pull_request: + +env: + WEBSITE_URL: 'eoed-docs.eliatra.com' + +jobs: + setup: + runs-on: ubuntu-latest + outputs: + ruby-version: '3.2' + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + build: + needs: setup + runs-on: ubuntu-latest + outputs: + version: ${{ steps.config.outputs.version }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ needs.setup.outputs.ruby-version }} + bundler-cache: true + - id: config + name: Update _config.yml + run: | + sed -i '/^url:/c\url: "https://${{ env.WEBSITE_URL }}"' _config.yml + WEBSITE_VERSION=$(cat _config.yml | grep "^opensearch_major_minor_version:" | cut -d ':' -f2 | tr -d " '") + echo "version=$WEBSITE_VERSION" >> $GITHUB_OUTPUT + sed -i '/^baseurl:/c\baseurl: "/docs/'"$WEBSITE_VERSION"'"' _config.yml + cat _config.yml|grep -e "^url:" -e "^baseurl:" + - run: JEKYLL_FATAL_LINK_CHECKER=internal JEKYLL_ENV=production bundle exec jekyll build --future + - uses: actions/upload-artifact@v4 + with: + name: site-artifacts + path: _site + retention-days: 1 + + deploy: + needs: build + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' + steps: + - uses: actions/download-artifact@v4 + with: + name: site-artifacts + path: _site + + + - name: Install SSH key + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SFTP_SSH_PRIVATE_KEY }} + + - name: Upload Folder + run: | + sudo apt install lftp -y + lftp --version + WEBSITE_VERSION=${{ needs.build.outputs.version }} + if [ -z "$WEBSITE_VERSION" ]; then + echo "WEBSITE_VERSION is empty" + exit 1 + fi + echo "Start SFTP upload version: $WEBSITE_VERSION" + lftp -u ${{ secrets.SFTP_USERNAME }}, -e "set sftp:connect-program 'ssh -a -x -o StrictHostKeyChecking=no'; mkdir -p /var/www/${{ env.WEBSITE_URL }}/html/$WEBSITE_VERSION; mirror --reverse --parallel=20 --verbose _site/ /var/www/${{ env.WEBSITE_URL }}/html/$WEBSITE_VERSION/; quit" sftp://${{ secrets.SFTP_SERVER }} + + post_deploy: + needs: deploy + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' + steps: + - name: Purge Cloudflare Cache + run: | + STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" \ + -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.ELIATRA_CLOUDFLARE_ZONEID }}/purge_cache" \ + -H "Authorization: Bearer ${{ secrets.ELIATRA_CLOUDFLARE_DECACHE_TOKEN }}" \ + -H "Content-Type: application/json" \ + --data '{"purge_everything":true}') + if [ "$STATUS_CODE" -ne 200 ]; then + echo "Cloudflare API call failed with status $STATUS_CODE" + exit 1 + else + echo "Cloudflare cache purged successfully" + fi diff --git a/.github/workflows/vale.yml b/.github/workflows/vale.yml deleted file mode 100644 index d147c690e8..0000000000 --- a/.github/workflows/vale.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Style check - -on: - pull_request: - workflow_dispatch: - -jobs: - style-job: - runs-on: ubuntu-latest - steps: - - name: Check out - uses: actions/checkout@v3 - - - name: Run Vale - uses: errata-ai/vale-action@reviewdog - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - fail_on_error: false - reporter: github-pr-check - filter_mode: added - vale_flags: "--no-exit" \ No newline at end of file diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000000..77470cb39f --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file