Qwik Build
GitHub Action to build
your Qwik[City] static site for GitHub Pages.
First enable GitHub Pages under your repository Settings
> Pages
by changing the source to GitHub Actions
:
This action will look in package.
[yaml
/json
] scripts
for the first script
containing a qwik
build
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.
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. |
.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