Skip to content
package

GitHub Action

Sapper Action

1.1.0 Latest version

Sapper Action

package

Sapper Action

Build your Sapper-based static website

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Sapper Action

uses: koddr/actions-sapper@1.1.0

Learn more about this action in koddr/actions-sapper

Choose a version

:octocat: GitHub Action for Sapper

Use this action to build your static website with Sapper.

GitHub Action for Sapper

☝️ 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 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:

- 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

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.

💡 Deploy to remote virtual server (VDS/VPS/Droplet) via SSH

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 & True web artisans.