From cb774008926ebe5bfdbc7ca02b1b5622b10d6841 Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Fri, 5 Jan 2024 05:20:47 -0800 Subject: [PATCH] Set up GitHub Pages --- .github/workflows/ci.yml | 16 +++++++++++++++- .gitignore | 1 + MAINTAINERS.md | 2 ++ README.md | 7 +++++++ index.html | 2 +- src/button.tsx | 2 +- src/worker-client.ts | 2 +- toast.yml | 16 ++++++++++++++-- 8 files changed, 42 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac16c49..bd892c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,21 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - uses: stepchowfun/toast/.github/actions/toast@main with: - tasks: build check + tasks: build check release docker_repo: stephanmisc/toast read_remote_cache: ${{ github.event_name == 'push' }} write_remote_cache: ${{ github.event_name == 'push' }} + - uses: actions/configure-pages@v4 + - uses: actions/upload-pages-artifact@v3 + deploy_github_pages: + name: Deploy to GitHub pages + needs: ci + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + permissions: + pages: write + id-token: write + steps: + - uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 1cd8faf..0b18067 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # [tag:gitignore] Keep this in sync with [ref:excluded_input_paths]. +/_site/ /dist/ /generated/ /hashpass.zip diff --git a/MAINTAINERS.md b/MAINTAINERS.md index e0e338f..5638b7b 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -18,6 +18,8 @@ When setting up the repository on GitHub, configure the following settings: - Add the `Validate` status check. - Enable `Include administrators`. - Under `Options`, enable `Automatically delete head branches`. +- Under `Pages`, change the `Source` to `GitHub Actions` and check + `Enforce HTTPS`. ### Release instructions diff --git a/README.md b/README.md index 4ed11c6..3a5b759 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,10 @@ You can install Hashpass from the Chrome Web Store Then you can find the Hashpass button next to your address bar or in the extensions dropdown. By default, you can also open Hashpass with `Ctrl+Shift+P` (`Cmd+Shift+P` on macOS). + +## Website + +Hashpass is also available on the web at +[stepchowfun.github.io/hashpass](https://stepchowfun.github.io/hashpass/), +although the Chrome extension is generally more ergonomic to use since it can +interact with the page you're logging into. diff --git a/index.html b/index.html index 4df567e..8a34a70 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,6 @@ - + diff --git a/src/button.tsx b/src/button.tsx index 0e83be9..a140f04 100644 --- a/src/button.tsx +++ b/src/button.tsx @@ -76,7 +76,7 @@ export const Button = ({ title={description} type={buttonType.type === 'submit' ? 'submit' : 'button'} > - + ); }; diff --git a/src/worker-client.ts b/src/worker-client.ts index 050ca34..487822c 100644 --- a/src/worker-client.ts +++ b/src/worker-client.ts @@ -1,7 +1,7 @@ import type { Request, Response } from './worker-protocol'; // Spawn a web worker for offloading password generation to a dedicated thread. -const worker = new Worker('/dist/worker.bundle.js'); +const worker = new Worker('dist/worker.bundle.js'); // Each message has a unique auto-incrementing identifier. let nextMessageId = 0; diff --git a/toast.yml b/toast.yml index 3314441..0b3ba60 100644 --- a/toast.yml +++ b/toast.yml @@ -63,6 +63,7 @@ tasks: - .git # [tag:excluded_input_paths] Keep this in sync with [ref:gitignore]. + - _site/ - dist/ - generated/ - hashpass.zip @@ -105,9 +106,20 @@ tasks: - index.html - manifest.json output_paths: + - _site - hashpass.zip command: | - # Create a ZIP file containing the relevant files. + # Create a directory containing the relevant files for the website. + mkdir _site + cp -R \ + HEROICONS-LICENSE.md \ + LICENSE.md \ + dist \ + images \ + index.html \ + _site + + # Create a ZIP file containing the relevant files for the Chrome extension. zip -r hashpass.zip \ HEROICONS-LICENSE.md \ LICENSE.md \ @@ -118,7 +130,7 @@ tasks: src # Inform the user of where the artifact is. - echo 'Generated `hashpass.zip`.' + echo 'Generated `_site` and `hashpass.zip`.' format: description: Format the source code.