Skip to content

Commit ed30471

Browse files
committed
Add Qwik starter workflow
1 parent a094118 commit ed30471

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

pages/qwik.yml

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Sample workflow for building and deploying a Qwik City site to GitHub Pages
2+
#
3+
# To get started with Qwik see: https://qwik.builder.io/docs/getting-started/
4+
#
5+
name: Deploy Qwik site to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: [$default-branch]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
env:
28+
BUILD_PATH: "." # default value when not using subfolders
29+
# BUILD_PATH: subfolder
30+
31+
jobs:
32+
build:
33+
name: Build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Detect package manager
39+
id: detect-package-manager
40+
run: |
41+
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
42+
echo "manager=yarn" >> $GITHUB_OUTPUT
43+
echo "command=install" >> $GITHUB_OUTPUT
44+
echo "runner=yarn" >> $GITHUB_OUTPUT
45+
exit 0
46+
elif [ -f "${{ github.workspace }}/package.json" ]; then
47+
echo "manager=npm" >> $GITHUB_OUTPUT
48+
echo "command=ci" >> $GITHUB_OUTPUT
49+
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
50+
exit 0
51+
else
52+
echo "Unable to determine package manager"
53+
exit 1
54+
fi
55+
- name: Setup Node
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: "20"
59+
cache: ${{ steps.detect-package-manager.outputs.manager }}
60+
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json
61+
- name: Setup Pages
62+
id: pages
63+
uses: actions/configure-pages@v4
64+
- name: Install dependencies
65+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
66+
working-directory: ${{ env.BUILD_PATH }}
67+
- name: Build with Qwik
68+
run: ${{ steps.detect-package-manager.outputs.runner }} qwik build
69+
working-directory: ${{ env.BUILD_PATH }}
70+
- name: Upload artifact
71+
uses: actions/upload-pages-artifact@v2
72+
with:
73+
path: ${{ env.BUILD_PATH }}/dist
74+
75+
deploy:
76+
environment:
77+
name: github-pages
78+
url: ${{ steps.deployment.outputs.page_url }}
79+
needs: build
80+
runs-on: ubuntu-latest
81+
name: Deploy
82+
steps:
83+
- name: Deploy to GitHub Pages
84+
id: deployment
85+
uses: actions/deploy-pages@v3

0 commit comments

Comments
 (0)