chore: remove website setup

This commit is contained in:
jo 2022-12-19 16:41:01 +01:00 committed by Jonas L
parent 16096b6b83
commit dc0353c1d3
9 changed files with 7 additions and 233 deletions

10
.github/renovate.json vendored
View File

@ -24,17 +24,9 @@
"addLabels": ["python"], "addLabels": ["python"],
"rangeStrategy": "widen" "rangeStrategy": "widen"
}, },
{
"matchPaths": ["website/**"],
"addLabels": ["javascript"]
},
{ {
"matchUpdateTypes": ["patch"], "matchUpdateTypes": ["patch"],
"matchPaths": [ "matchPaths": [".github/workflows/*", ".pre-commit-config.yaml"],
".github/workflows/*",
".pre-commit-config.yaml",
"website/**"
],
"automerge": true "automerge": true
} }
] ]

View File

@ -1,21 +0,0 @@
name: Command
on:
issue_comment:
types: [created]
jobs:
dispatch:
name: Dispatch
runs-on: ubuntu-latest
steps:
- name: Dispatch website preview
uses: peter-evans/slash-command-dispatch@v3
with:
token: ${{ secrets.COMMAND_DISPATCH_TOKEN }}
issue-type: pull-request
dispatch-type: workflow
commands: website-preview
static-args: |
pull-request-number=${{ github.event.issue.number }}

View File

@ -7,7 +7,6 @@ on:
- .github/vale/** - .github/vale/**
- .github/workflows/docs.yml - .github/workflows/docs.yml
- docs/** - docs/**
- website/**
pull_request: pull_request:
branches: [main] branches: [main]
@ -15,7 +14,6 @@ on:
- .github/vale/** - .github/vale/**
- .github/workflows/docs.yml - .github/workflows/docs.yml
- docs/** - docs/**
- website/**
jobs: jobs:
lint: lint:
@ -51,5 +49,5 @@ jobs:
- name: Run Vale - name: Run Vale
run: | run: |
vale sync vale sync
vale --output line docs website/src/pages || true vale --output line docs || true
vale --output line --minAlertLevel=error docs/releases vale --output line --minAlertLevel=error docs/releases

View File

@ -27,7 +27,7 @@ jobs:
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
issueLimit: ${{ github.event.inputs.issueLimit || '5' }} issueLimit: ${{ github.event.inputs.issueLimit || '5' }}
ignore: .git,/docs/releases/*,/website/versioned*,CHANGELOG.md ignore: .git,/docs/releases/*,CHANGELOG.md
find_broken_links: find_broken_links:
if: github.repository_owner == 'libretime' if: github.repository_owner == 'libretime'
@ -49,7 +49,6 @@ jobs:
with: with:
args: >- args: >-
'**/*.md' '**/*.md'
--exclude-path 'website/versioned_docs'
--require-https --require-https
--exclude-all-private --exclude-all-private
--exclude-mail --exclude-mail

View File

@ -1,118 +0,0 @@
name: Website Preview
on:
workflow_dispatch:
inputs:
pull-request-number:
description: "Pull request number to preview"
required: true
type: string
pull_request_target:
types: [closed]
branches: [main]
paths:
- website/**
- docs/**
env:
# PREVIEW_DEPLOY_KEY is present in the secrets
PREVIEW_EXTERNAL_REPOSITORY: libretime/libretime.github.io
PREVIEW_EXTERNAL_REPOSITORY_BRANCH: gh-pages
PREVIEW_URL: https://libretime.github.io
PREVIEW_BASE_URL: /
jobs:
deploy:
if: github.event_name == 'workflow_dispatch'
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout pull request
run: hub pr checkout ${{ github.event.inputs.pull-request-number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: yarn
cache-dependency-path: website/yarn.lock
- name: Install
working-directory: website
run: yarn install --frozen-lockfile
- name: Build
working-directory: website
run: yarn build
env:
URL: ${{ env.PREVIEW_URL }}
BASE_URL: ${{ env.PREVIEW_BASE_URL }}pr-${{ github.event.inputs.pull-request-number }}/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: ${{ env.PREVIEW_EXTERNAL_REPOSITORY }}
deploy_key: ${{ secrets.PREVIEW_DEPLOY_KEY }}
publish_dir: website/build
destination_dir: pr-${{ github.event.inputs.pull-request-number }}
full_commit_message: "deploy pr-${{ github.event.inputs.pull-request-number }}"
keep_files: true
- name: Find deployment comment
uses: peter-evans/find-comment@v2
id: find-comment
with:
issue-number: ${{ github.event.inputs.pull-request-number }}
comment-author: github-actions[bot]
body-includes: Website preview deployment
- name: Notify deployment succeeded
if: ${{ success() }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.inputs.pull-request-number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: |
**:rocket: Website preview deployment succeeded!**
Website preview: ${{ env.PREVIEW_URL }}${{ env.PREVIEW_BASE_URL }}pr-${{ github.event.inputs.pull-request-number }}/
New docs preview: ${{ env.PREVIEW_URL }}${{ env.PREVIEW_BASE_URL }}pr-${{ github.event.inputs.pull-request-number }}/docs/next/
Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Notify deployment failed
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.inputs.pull-request-number }}
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
body: |
**:boom: Website preview deployment failed!**
Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
clean:
if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
name: Clean
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ env.PREVIEW_EXTERNAL_REPOSITORY }}
ref: ${{ env.PREVIEW_EXTERNAL_REPOSITORY_BRANCH }}
ssh-key: ${{ secrets.PREVIEW_DEPLOY_KEY }}
- name: Remove files
run: rm -fR pr-${{ github.event.pull_request.number }}
- uses: endbug/add-and-commit@v9
with:
message: "clean pr-${{ github.event.pull_request.number }}"

View File

@ -1,53 +0,0 @@
name: Website
on:
push:
branches: [main]
paths:
- .github/workflows/website.yml
- docs/**
- website/**
pull_request:
branches: [main]
paths:
- .github/workflows/website.yml
- docs/**
- website/**
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: yarn
cache-dependency-path: ./website/yarn.lock
- uses: actions/cache@v3
with:
path: website/.docusaurus
key: docusaurus-main-${{ github.sha }}
restore-keys: |
docusaurus-main-
- name: Install
working-directory: website
run: yarn install --frozen-lockfile
- name: Build
working-directory: website
run: yarn build
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: website/build

View File

@ -36,4 +36,4 @@ clean:
docs-lint: docs-lint:
vale sync vale sync
vale docs website/src/pages vale docs

View File

@ -1,4 +1,4 @@
![](website/static/img/logo-512px.png) ![](https://github.com/libretime/website/blob/main/static/img/logo-512px.png)
[![Financial Contributors on Open Collective](https://opencollective.com/libretime/all/badge.svg?label=financial+contributors)](https://opencollective.com/libretime) [![Financial Contributors on Open Collective](https://opencollective.com/libretime/all/badge.svg?label=financial+contributors)](https://opencollective.com/libretime)

View File

@ -102,30 +102,7 @@ git add .
git commit --fixup ":/$COMMIT_MESSAGE" git commit --fixup ":/$COMMIT_MESSAGE"
``` ```
### 3. Website and docs ### 3. Create a new pull request
Update the version in the website files, the files that need changing are:
- `website/vars.js`
- `website/versions.json`
Replace the old versioned docs with the current docs:
```bash
mv website/versioned_sidebars/version-*-sidebars.json website/versioned_sidebars/version-$VERSION-sidebars.json
rm -R website/versioned_docs/version-*
cp -R docs website/versioned_docs/version-$VERSION
```
Commit the website and docs changes:
```bash
git add .
git commit --fixup ":/$COMMIT_MESSAGE"
```
### 4. Create a new pull request
Squash the changes and open a pull request for others to review: Squash the changes and open a pull request for others to review:
@ -135,7 +112,7 @@ git rebase --autosquash --interactive main
Merge the pull request when it's reviewed and ready. Merge the pull request when it's reviewed and ready.
### 5. Create and push a tag ### 4. Create and push a tag
Pull the merged release commit: Pull the merged release commit: