Skip to content

Commit b0dee09

Browse files
authored
Merge pull request #502 from citation-file-format/readme-preview
2 parents 4e77497 + 7b2135d commit b0dee09

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.dev.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@ git push origin gh-pages
111111
- After `gh-pages` is created, select it as the source for deployment of [GitHub pages](https://github.com/citation-file-format/cff-initializer-javascript/settings/pages).
112112
- Enable write permissions for `secrets.GITHUB_TOKEN` on workflows (see, e.g. [this post](https://github.com/peaceiris/actions-gh-pages/issues/744#issuecomment-1119685318)). This is done on [Settings -> Actions -> General -> Workflow permissions](https://github.com/citation-file-format/cff-initializer-javascript/settings/actions).
113113

114+
## Previewing
115+
116+
This is app is previewed using [Netlify](https://netlify.com) automatically by the [Preview workflow](.github/workflows/preview.yml).
117+
The main branch is previewed into <https://cffinit.netlify.app/main> and each Pull Request is previewing into a `https://cffinit.netlify.app/PRXXX` page.
118+
The way this works is:
119+
120+
- The branch `gh-preview` is served by Netlify. There is a folder `main` and several folders `PRXXX` in that branch.
121+
- After a Pull Request or a push to `main` is created, the workflow runs.
122+
- The workflow changes the `publicPath` configuration in [quasar.conf.js](quasar.conf.js) to reflect the folder `main` or `PRXXX`.
123+
- This is stored in a environment variable `PUBLICPATH` to be used later.
124+
- We use `sed` with a `-i` to replace the value in-place.
125+
- The workflow builds the app (using the `npm run build` command) into a folder `./dist`.
126+
- The GitHub action `peaceiris/actions-gh-pages@v3` pushes the contents of `./dist` to the branch [gh-preview](https://github.com/citation-file-format/cff-initializer-javascript/tree/gh-preview) in the indicated path.
127+
- After the push is complete, we create a comment on the pull request (if applicable) with the link to the preview page.
128+
129+
For this to work, you need a `gh-preview` branch to exist and to enable write permissions for `secrets.GITHUB_TOKEN`.
130+
See the section on [Publishing](#publishing) for details on how to do this.
131+
114132
## Making a release
115133

116134
This section describes how to make a release in 2 parts:

0 commit comments

Comments
 (0)