-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 32edec4
Showing
9 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
cache: "npm" | ||
- name: Install npm dependencies | ||
run: npm install | ||
- name: Build | ||
run: npm run build | ||
- name: Fix permissions | ||
run: | | ||
chmod -c -R +rX "build/" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: build/ | ||
deploy: | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# npm | ||
/node_modules | ||
|
||
# Suri | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Justin Stayton | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Suri × Deploy to GitHub Pages | ||
|
||
You're viewing a template repository tailored for deploying Suri to | ||
[GitHub Pages](https://pages.github.com/). | ||
|
||
What's Suri? Suri is your own link shortener that's easily deployed as a static | ||
site. No server-side hosting, serverless cloud functions, or database necessary. | ||
Head over to the main [`jstayton/suri`](https://github.com/jstayton/suri) | ||
repository to learn more, including additional deployment methods. | ||
|
||
## Install | ||
|
||
_TBD_ | ||
|
||
## Manage Links | ||
|
||
Links are managed through [`./src/links.json`](./src/links.json), which is | ||
seeded with a few examples to start: | ||
|
||
```json | ||
{ | ||
"/": "https://github.com/jstayton/suri", | ||
"1": "https://fee.org/articles/the-use-of-knowledge-in-society/", | ||
"tw": "https://twitter.com" | ||
} | ||
``` | ||
|
||
It couldn't be simpler: the key is the "shortlink" path that gets redirected, | ||
and the value is the target URL. Keys can be as short or as long as you want, | ||
using whatever mixture of characters you want. `/` is a special entry for | ||
redirecting the root path. | ||
|
||
Go ahead and make an edit, then commit and push to your repository. GitHub Pages | ||
should automatically build and deploy your change. That's it! | ||
|
||
## Config | ||
|
||
Config options are set in [`suri.config.json`](suri.config.json). There is only | ||
one at this point: | ||
|
||
| Option | Description | Type | Default | | ||
| ------ | ------------------------------------------------------------------ | ------- | ------- | | ||
| `js` | Whether to redirect with JavaScript instead of a `<meta>` refresh. | Boolean | `false` | |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@suri/deploy-github", | ||
"version": "1.0.0", | ||
"private": true, | ||
"type": "module", | ||
"description": "A template repository tailored for deploying Suri to GitHub Pages", | ||
"homepage": "https://github.com/staticsuri/suri-deploy-github#readme", | ||
"bugs": "https://github.com/staticsuri/suri-deploy-github/issues", | ||
"license": "MIT", | ||
"repository": "staticsuri/suri-deploy-github", | ||
"scripts": { | ||
"build": "suri" | ||
}, | ||
"devDependencies": { | ||
"suri": "github:jstayton/suri#v1" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"/": "https://github.com/jstayton/suri", | ||
"1": "https://fee.org/articles/the-use-of-knowledge-in-society/", | ||
"tw": "https://twitter.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"js": false | ||
} |