Skip to content

Commit 51b4d4b

Browse files
Update workflows (#13)
* Switch JSON-style arrays to YAML sequences * Skip GitHub Pages for changes to the playground * Add docs for `pages.yml`
1 parent fcc0f5b commit 51b4d4b

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: CI
22

33
on:
44
push:
5-
branches: ['main']
5+
branches:
6+
- main
67
pull_request:
7-
branches: ['main']
8+
branches:
9+
- main
810

911
jobs:
1012
ci:

packages/create-vue-lib/src/template/ci/config/.github/workflows/ci.yml.ejs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: CI
22

33
on:
44
push:
5-
branches: ['main']
5+
branches:
6+
- main
67
pull_request:
7-
branches: ['main']
8+
branches:
9+
- main
810

911
jobs:
1012
ci:

packages/create-vue-lib/src/template/gh-pages/config/.github/workflows/pages.yml.ejs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ name: Deploy to GitHub Pages
44
on:
55
# Runs on pushes targeting the default branch
66
push:
7-
branches: ['main']
7+
branches:
8+
- main
9+
<%_ if (config.includePlayground) { _%>
10+
paths-ignore:
11+
- '<%- config.packagesDir %>playground/**'
12+
<%_ } _%>
813

914
# Allows you to run this workflow manually from the Actions tab
1015
workflow_dispatch:

packages/docs/src/why.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ For `__TEST__` we replace the value with a simple `true` or `false`, which can b
8888

8989
For `__DEV__` it's a little more complicated, because in some builds we replace it with `!(process.env.NODE_ENV === "production")`. This allows the downstream bundler to make the decision about what mode we're in. We can't use `define` for a complex value like this, so `@rollup/plugin-replace` is used instead.
9090

91+
## `pages.yml`
92+
93+
The file `.github/worksflows/pages.yml` configures the GitHub Pages workflow for the documentation. The exact name of the file is not important, GitHub will run all workflows configured in `.github/workflows`.
94+
95+
The configuration is similar to those found at:
96+
97+
- https://vite.dev/guide/static-deploy.html#github-pages
98+
- https://vitepress.dev/guide/deploy#github-pages
99+
100+
pnpm is enabled in the configuration, but a specific version isn't specified as we're using the `packageManager` option in `package.json`.
101+
102+
The workflow is configured to run on the `main` branch. You'd typically want the documentation to reflect the latest release, so whether `main` is an appropriate choice will depend on your release process.
103+
104+
The [`paths-ignore`](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushpull_requestpull_request_targetpathspaths-ignore) setting can be used to avoid running GitHub Pages for changes that don't impact the documentation. The default configuration will only ignore the playground package. Trying to be really precise about what changes trigger the workflow is error-prone and the small gains usually aren't worth the extra effort.
105+
106+
You'll also need to enable GitHub Pages in the settings for your repo.
107+
91108
## `jiti`
92109

93110
The package `jiti` is included so that ESLint can use a TypeScript configuration file:

0 commit comments

Comments
 (0)