Skip to content

Commit 7607808

Browse files
authored
Create static.yml
1 parent c43a858 commit 7607808

File tree

1 file changed

+154
-0
lines changed

1 file changed

+154
-0
lines changed

.github/workflows/static.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["main"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Setup Pages
35+
uses: actions/configure-pages@v5
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
# Upload entire repository
40+
path: '.'
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4
44+
name: webpack-cli
45+
46+
on:
47+
push:
48+
branches:
49+
- main
50+
- next
51+
pull_request:
52+
branches:
53+
- main
54+
- next
55+
56+
permissions:
57+
contents: read
58+
59+
jobs:
60+
lint:
61+
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}
62+
runs-on: ${{ matrix.os }}
63+
concurrency:
64+
group: lint-${{ github.ref }}
65+
cancel-in-progress: true
66+
strategy:
67+
matrix:
68+
os: [ubuntu-latest]
69+
node-version: [18.x]
70+
webpack-version: [latest]
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Using Node v${{ matrix.node-version }}
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: ${{ matrix.node-version }}
78+
cache: "yarn"
79+
80+
- name: Install dependencies
81+
run: yarn --frozen-lockfile --ignore-engines
82+
83+
- name: Build
84+
run: yarn build
85+
86+
- name: Lint
87+
run: yarn lint
88+
89+
build:
90+
name: Tests and Coverage - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}, DevServer ${{ matrix.dev-server-version }} (${{ matrix.shard }})
91+
runs-on: ${{ matrix.os }}
92+
concurrency:
93+
group: build-${{ github.ref }}
94+
cancel-in-progress: true
95+
strategy:
96+
matrix:
97+
os: [ubuntu-latest, windows-latest, macos-latest]
98+
node-version: [18.x, 20.x, 22.x, 24.x]
99+
shard: ["1/4", "2/4", "3/4", "4/4"]
100+
webpack-version: [latest]
101+
dev-server-version: [latest]
102+
steps:
103+
- uses: actions/checkout@v4
104+
with:
105+
fetch-depth: 0
106+
107+
- name: Using Node v${{ matrix.node-version }}
108+
uses: actions/setup-node@v4
109+
with:
110+
node-version: ${{ matrix.node-version }}
111+
cache: "yarn"
112+
113+
- uses: pnpm/action-setup@v4
114+
with:
115+
version: 9
116+
117+
- name: Install dependencies
118+
run: yarn --frozen-lockfile --ignore-engines --ignore-scripts
119+
120+
- name: Prepare environment for tests
121+
run: yarn build:ci
122+
123+
- name: Run tests and generate coverage
124+
run: yarn test:coverage --ci --shard=${{ matrix.shard }}
125+
126+
- name: Upload coverage to Codecov
127+
uses: codecov/codecov-action@v5
128+
with:
129+
token: ${{ secrets.CODECOV_TOKEN }}
130+
verbose: true
131+
132+
smoketests:
133+
name: Smoketests - ${{ matrix.os }} - Node v${{ matrix.node-version }}
134+
runs-on: ${{ matrix.os }}
135+
concurrency:
136+
group: smoketests-${{ github.ref }}
137+
cancel-in-progress: true
138+
strategy:
139+
matrix:
140+
os: [ubuntu-latest]
141+
node-version: [lts/*]
142+
steps:
143+
- uses: actions/checkout@v4
144+
with:
145+
fetch-depth: 0
146+
147+
- name: Using Node v${{ matrix.node-version }}
148+
uses: actions/setup-node@v4
149+
with:
150+
node-version: ${{ matrix.node-version }}
151+
cache: "yarn"
152+
153+
- name: Install dependencies
154+
run: yarn --frozen-lockfile --ignore-engines

0 commit comments

Comments
 (0)