Skip to content
zap

GitHub Action

Qwik Build

v1.0.0 Latest version

Qwik Build

zap

Qwik Build

GitHub Action to build your Qwik[City] static site for GitHub Pages

Installation

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

              

- name: Qwik Build

uses: danielbayley/qwik-build@v1.0.0

Learn more about this action in danielbayley/qwik-build

Choose a version

Qwik Build

GitHub Action to build your Qwik[City] static site for GitHub Pages.

Usage

First enable GitHub Pages under your repository Settings > Pages by changing the source to GitHub Actions:

screenshot

This action will look in package.[yaml/json] scripts for the first script containing a qwikbuild command and run it with [p]npm or yarn, as appropriate:

// package.json
"devDependencies": {
  "@builder.io/qwik": "^1.x",
  "eslint": "^8.x",
  "vite": "^5.x"
},
"scripts": {
  "lint": "eslint .",
  "build": "qwik build", // [p]npm/yarn run build
  "dev": "vite --mode ssr"
}

it will also configure Qwik for static site generation, unless you already run qwik add static.

Because it runs the appropriate build script, support for Civet —a language that compiles to TypeScript and JSX—can be added:

# package.yaml
packageManager: pnpm@8.12.1
devDependencies:
  "@builder.io/qwik": ^1.x
  "@danielx/civet": ^0.x
scripts:
  prebuild: civet --compile src/**/*.civet --output .tsx
  build: qwik build # pnpm run build

Although a more official integration is preferred.

Options

inputs Default Description
access-token github.token Provide a token with permission to automatically enable Pages. Generate an access token, then add to your repo secrets.
branch github.ref_name Optionally specify a particular branch of your repository.
working-dir github.workspace Optionally specify a subfolder containing source files.
build-dir dist Optionally specify an alternative build folder.
node-version Optionally specify a SemVer range or particular version of Node.js.
node-version-file package.json Optionally specify a file containing the correct version of Node.

Example

.github/workflows/pages.yml:

on:
  push:
    branches: site

permissions:
  pages: write
  id-token: write

concurrency:
  group: pages
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.qwik-build.outputs.page-url }}

    steps:
    - name: Qwik Build
      id: qwik-build
      uses: danielbayley/qwik-build@v1
      with:
        branch: site

License

MIT © Daniel Bayley