https://github.com/koddr/actions-sapper
:octocat: GitHub Action for generating a static website with Sapper.
https://github.com/koddr/actions-sapper
action actions demo github-actions github-page sapper sapper-app static static-site-generator static-website svelte svelte-v3 svelte3
Last synced: 7 months ago
JSON representation
:octocat: GitHub Action for generating a static website with Sapper.
- Host: GitHub
- URL: https://github.com/koddr/actions-sapper
- Owner: koddr
- License: mit
- Created: 2020-06-07T05:42:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-22T21:55:01.000Z (over 5 years ago)
- Last Synced: 2024-09-29T12:02:50.272Z (over 1 year ago)
- Topics: action, actions, demo, github-actions, github-page, sapper, sapper-app, static, static-site-generator, static-website, svelte, svelte-v3, svelte3
- Language: Shell
- Homepage: https://github.com/marketplace/actions/sapper-action
- Size: 41 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :octocat: GitHub Action for Sapper
Use this action to build your static website with [Sapper](https://sapper.svelte.dev/).

## βοΈ How to use?
To use it, create a `.github/workflows/sapper_build.yml` file in your Sapper-based website repository as an action.
> π **Tip**: read [this article](https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idsteps) to more understand GitHub Actons steps.
## βοΈ Inputs
This action accepts a couple of _optional_ inputs:
| Input Name | Required? | Default | Description |
| ------------ | :-------: | ------------ | ------------------------------------------ |
| `build_mode` | No | `"export"` | Build mode to the Sapper |
| `args` | No | `none` | Arguments to pass to the Sapper invocation |
For example:
```yaml
- name: Build
uses: truewebartisans/actions-sapper@master
with:
build_mode: "export"
args: "--legacy --entry about"
```
## π More complex examples
These are examples, which _builds the website_ with this action, then deploys with another action.
### π‘ Deploy to GitHub Pages
- Deploy action: [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages)
```yaml
name: Build Sapper and Deploy to GitHub Pages
on: [push]
jobs:
build_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Sapper
uses: truewebartisans/actions-sapper@master
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@master
with:
publish_dir: __sapper__/export
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
```
#### πΊ GitHub Pages demo repository
This demo for Sapper-based website was build with `export` flag and deployed to GitHub Pages from `gh-pages` branch.
- Repository: https://github.com/truewebartisans/actions-sapper-demo
- Live result: https://sapper-action.gh.1wa.co
### π‘ Deploy to remote virtual server (VDS/VPS/Droplet) via SSH
- Deploy action: [appleboy/scp-action](https://github.com/appleboy/scp-action)
```yaml
name: Build Sapper and Deploy to remote virtual server via SSH
on: [push]
jobs:
build_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Sapper
uses: truewebartisans/actions-sapper@master
with:
build_mode: "build"
- name: Deploy to remote virtual server via SSH
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_KEY }}
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }}
rm: true
source: __sapper__/build/
target: ${{ secrets.REMOTE_DIR }}
```
## π License
MIT Β© [Vic ShΓ³stak](https://github.com/koddr) & [True web artisans](https://1wa.co/).