Deploy to Netlify with redirect support (#50)

* Removing Fission publish action and configuration info from README

* Document the Netlify deployment information in the README
This commit is contained in:
Jess Martin 2022-08-31 10:10:04 -04:00 committed by GitHub
parent 9a1532715a
commit 3c8429082e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 59 deletions

View File

@ -1,26 +0,0 @@
name: 🚀 Publish
on:
push:
branches:
- main
jobs:
publish_job:
name: '🚀 Publish'
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v2
- name: 🧱 Setup node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: 📦 Install packages
run: npm install
- name: 🏗 Build assets
run: npm run build
- name: 🚀 Publish to production
uses: fission-suite/publish-action@v1
with:
machine_key: ${{ secrets.FISSION_MACHINE_KEY }}
app_url: webnative-app-template.fission.app
build_dir: ./build

View File

@ -1,4 +1,6 @@
# webnative-app-template
# Webnative App Template
[![Netlify Status](https://api.netlify.com/api/v1/badges/7b7418ef-86eb-43c4-a668-0118568c7f46/deploy-status)](https://app.netlify.com/sites/webnative/deploys)
A web app template for Webnative.
@ -18,7 +20,7 @@ Work on the application in local development.
npm run dev
```
Navigate to `localhost:3000` in your web browser.
Navigate to `http://localhost:5173` in your web browser.
## Build
@ -32,26 +34,11 @@ The build outputs the static site to the `build` directory.
## Publish
The built site publishes with the [Fission CLI](https://guide.fission.codes/developers/cli) and the [Fission GH publish action](https://github.com/fission-suite/publish-action). Publishing from the command line is configured in [fission.yaml](fission.yaml), and the GitHub publish action is configured in [publish.yml](.github/workflows/publish.yml).
NOTE: SvelteKit Single-Page Applications require redirects in order to support routing. This is not currently supported by IPFS, so the [Fission Publish GitHub action](https://github.com/fission-codes/publish-action) is not currently supported.
To configure your own CLI publishing:
The [Webnative Template App demo](https://webnative.netlify.app) is currently hosted on Netlify, but it should be supported on any static hosting platform (Vercel, Cloudflare Pages, etc).
1. [Install the Fission CLI](https://guide.fission.codes/developers/installation)
2. Run `fission setup` to make a Fission account
3. Run `npm run build` to build the app
4. Delete `fission.yaml`
5. Run `fission app register` to register a new Fission app (accept the `./build` directory suggestion for your build directory)
6. Run `fission app publish` to publish your app to the web
After publishing, your app will be available online at the domain assigned by the register command.
To set up the GitHub publish action:
1. Export your machine key with `base64 ~/.config/fission/key/machine_id.ed25519`
2. Add your machine key as a GH Repository secret named `FISSION_MACHINE_KEY`
3. Update the `publish.yml` with the name of your registered app
See the [Fission Guide](https://guide.fission.codes/developers/installation) and the publish action README for more details.
In order to deploy your own Webnative application on Netlify, simply create a new Netlify site connected to your app's repository and Netlify will take care of the rest. No Netlify-specific configuration is needed.
## Customize

View File

@ -1,3 +0,0 @@
ignore: []
url: webnative-app-template.fission.app
build: ./build

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{
"name": "svelte-elemetary-template",
"name": "webnative-app-template",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "svelte-elemetary-template",
"name": "webnative-app-template",
"version": "0.1.0",
"dependencies": {
"clipboard-copy": "^4.0.1",

View File

@ -1,5 +1,5 @@
{
"name": "svelte-elemetary-template",
"name": "webnative-app-template",
"version": "0.1.0",
"scripts": {
"dev": "vite dev",

View File

@ -3,17 +3,11 @@ import adapter from '@sveltejs/adapter-static'
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: preprocess({
postcss: true,
}),
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: null
}),
adapter: adapter(),
}
}