Skip to content

Commit

Permalink
Set up GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchowfun committed Jan 5, 2024
1 parent 64227e8 commit cb77400
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 6 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# [tag:gitignore] Keep this in sync with [ref:excluded_input_paths].
/_site/
/dist/
/generated/
/hashpass.zip
Expand Down
2 changes: 2 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
</head>
<body>
<script src="/dist/main.bundle.js"></script>
<script src="dist/main.bundle.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const Button = ({
title={description}
type={buttonType.type === 'submit' ? 'submit' : 'button'}
>
<img className={classes.icon} src={`/images/${imageName}.svg`} />
<img className={classes.icon} src={`images/${imageName}.svg`} />
</button>
);
};
2 changes: 1 addition & 1 deletion src/worker-client.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
16 changes: 14 additions & 2 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ tasks:
- .git

# [tag:excluded_input_paths] Keep this in sync with [ref:gitignore].
- _site/
- dist/
- generated/
- hashpass.zip
Expand Down Expand Up @@ -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 \
Expand All @@ -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.
Expand Down

0 comments on commit cb77400

Please sign in to comment.