Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track style css #52

Merged
merged 4 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ jobs:

- name: All the Test
run: go test ./...

- name: update style.css
run: |
pushd web/styles
npm ci
npm run compile-prod
popd

- name: push updated style.css
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update production style.css
file_pattern: web/assets/style.css

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ roomdb/sqlite/testrun

# build artifacts from node.js project web/styles
node_modules
web/assets/styles/compiled.*
web/assets/style.css
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ For an architecture and instructions on setting up a webserver to use with `go-s

## Development

(_TODO: move this section to contributing document_ See: https://github.com/ssb-ngi-pointer/go-ssb-room/issues/206 )

To get started, you need a recent version of [Go](https://golang.org). v1.16 and onward should be sufficient.

Also, if you want to develop the CSS and HTML on the website, you need Node.js v14 in order to compile Tailwind.

To build the server and see a list of its options:

```bash
Expand Down Expand Up @@ -71,16 +75,19 @@ This can be useful if you are working on:
* html templates,
* styling elements using [tailwind](https://tailwindcss.com/docs/)
* _if you don't run generate with `-tags dev`, the bundled css will only contain the tailwind classes found in *.tmpl at the time of generation!_
* or website assets
* or website templates or assets like JavaScript files, the favicon or other images that are used inside the HTML.

This way, the build won't use the assets embedded in the binary, but instead read them directly from the local filesystem.

Once you are done with your changes and want to update the embedded assets:
Once you are done with your changes and want to update the embedded assets to the production versions:
```sh
# cd to the root of the folder, and then run go generate
go generate -tags dev ./...
go generate ./...
# now build the server without the development mode
cd cmd/server && go build && ./server -htts-domain my.room.example
```


## Tooling
### Mocks

Expand Down
Loading