Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce next-gen status page #67

Merged
merged 27 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

27 changes: 27 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

23 changes: 15 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:

workflow_dispatch:

concurrency: provision_concurrency_group-${{ github.event.pull_request.number || github.ref_name }}

env:
# This is used during the build step (vite.config.js) to determine the base URL.
# https://vitejs.dev/guide/static-deploy#github-pages
DEPLOY_PATH: ${{ github.ref_name == 'main' && '/' || format('/previews/pr-{0}/{1}...{2}', github.event.pull_request.number, github.event.pull_request.base.sha, github.event.pull_request.head.sha) }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -23,13 +30,13 @@ jobs:
- name: Build
run: |
npm ci
npm run export
npm run build

- name: Upload build output
uses: actions/upload-artifact@v3
with:
name: build-output
path: ./out
path: ./dist

deploy_prod:
runs-on: ubuntu-latest
Expand All @@ -43,7 +50,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: build-output
path: ./out
path: ./dist

- name: Set up mutex
uses: ben-z/[email protected]
Expand All @@ -55,7 +62,7 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./out
folder: ./dist
clean-exclude: previews/*

deploy_preview:
Expand All @@ -75,7 +82,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: build-output
path: ./out
path: ./dist

- name: Set up mutex
uses: ben-z/[email protected]
Expand All @@ -87,8 +94,8 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./out
target-folder: './previews/pr-${{ github.event.pull_request.number }}/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}'
folder: ./dist
target-folder: '.${{ env.DEPLOY_PATH }}'

- name: Create comment
uses: peter-evans/create-or-update-comment@v2
Expand All @@ -99,4 +106,4 @@ jobs:
It will be ready in about a minute. [You can view it here][preview].

[compare]: ${{ github.event.pull_request.head.repo.html_url }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}
[preview]: ${{ github.event.pull_request.head.repo.homepage }}/previews/pr-${{ github.event.pull_request.number }}/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}
[preview]: ${{ github.event.pull_request.head.repo.homepage }}${{ env.DEPLOY_PATH }}
52 changes: 21 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/extensions.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

37 changes: 8 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
# WATonomous Status
# WATcloud Status Page

Still trying to see what this repo will be about. For now it's a barebones status page running on GitHub pages and using the healthchecks.io API. We can probably combine this with what's behind http://vm-status.watonomous.ca.
The [WATcloud Status Page](https://status.watonomous.ca) is a frontend-only web app that pulls data from various sources like [Healthchecks.io](https://healthchecks.io)
and [Sentry](https://sentry.io) to provide a single place to view the health of WATcloud.

- `/` contains all Terraform-provisioned checks.
- `/legacy` is adapted from [healthchecks-front](https://github.com/nicoandrade/healthchecks-front). This only supports one Healthchecks.io project.
- `/legacy2` is adapted from [healthchecks/dashboard](https://github.com/healthchecks/dashboard). This supports multiple Healthchecks.io projects, but the UI is not as intuitive as `/` at first glance.
## Development

### Development

To start a development server:
To run the status page locally, you will need to have [Node.js](https://nodejs.org/en/) installed.
Then, you can run the following commands to install dependencies and start the development server:

```bash
npm ci # install dependencies without updating them
npm install
npm run dev
```

### Testing

To verify that the static export is working, do this in the root of the project:

```bash
npm run export
cd out
python3 -m http.server 8082
```

Then head to http://localhost:8082 to ensure that the changes are as expected. \
Note: Go to http://localhost:8082/all.html to view to page to `/all`

### Deployment

We deploy healthchecks-front by [exporting the Next.js application as static HTML](https://nextjs.org/docs/advanced-features/static-html-export), then hosting it with [GitHub Pages](https://pages.github.com).

The HTML-generation process is currently automated with Github Actions. Any changes committed to `main` will trigger the [deployment process](https://github.com/WATonomous/status/actions/workflows/deploy.yml).
```
128 changes: 0 additions & 128 deletions components/Check.js

This file was deleted.

Loading
Loading