Skip to content

Commit 0f8b1e2

Browse files
authored
dev: remove netlify (#4014)
1 parent 8000aba commit 0f8b1e2

File tree

8 files changed

+16
-104
lines changed

8 files changed

+16
-104
lines changed

.github/workflows/post-release.yml

-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
- name: Update Contributors list
3434
run: make update_contributors_list # may take 15 min
3535

36-
- name: Update netlify state hash
37-
run: make update_netlify_state
38-
3936
- name: Create Pull Request
4037
uses: peter-evans/create-pull-request@v5
4138
with:

Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,3 @@ expand_website_templates:
108108
update_contributors_list:
109109
cd .github/contributors && npm run all
110110

111-
update_netlify_state:
112-
go run ./scripts/expand_website_templates/main.go -only-state

docs/src/docs/contributing/website.mdx

+10-25
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ title: Website architecture
44

55
## Technology
66

7-
We use [Gatsby](https://www.gatsbyjs.org/) for static site generation because sites built with it
8-
are very fast.
7+
We use [Gatsby](https://www.gatsbyjs.org/) for static site generation because sites built with it are very fast.
98

109
This framework uses React and JavaScript/TypeScript.
1110

@@ -16,9 +15,8 @@ The website lives in `docs/` directory of [golangci-lint repository](https://git
1615
## Theme
1716

1817
Initially the site is based on [@rocketseat](https://rocketdocs.netlify.app/) theme.
19-
Later we've merged it's code into `src/@rocketseat` because we needed too much changes
20-
and [gatsby shadowing](https://www.gatsbyjs.org/docs/themes/shadowing/) doesn't
21-
allow shadowing `gatsby-node.js` or `gatsby-config.js`.
18+
Later we've merged its code into `src/@rocketseat` because we needed too much changes
19+
and [gatsby shadowing](https://www.gatsbyjs.org/docs/themes/shadowing/) doesn't allow shadowing `gatsby-node.js` or `gatsby-config.js`.
2220

2321
## Navigation
2422

@@ -31,22 +29,15 @@ allowing to use `React` components.
3129

3230
## Templating
3331

34-
We use templates like `{.SomeField}` inside our `mdx` files. There templates are expanded
35-
by running `make expand_website_templates` in the root of the repository.
32+
We use templates like `{.SomeField}` inside our `mdx` files.
33+
There templates are expanded by running `make expand_website_templates` in the root of the repository.
3634
It runs script `scripts/expand_website_templates/main.go` that rewrites `mdx` files with replaced templates.
3735

38-
## CDN and DNS
39-
40-
We use [CloudFlare](https://www.cloudflare.com/) for CDN, proxying and DNS management.
41-
4236
## Hosting
4337

44-
We use [Netlify](https://www.netlify.com/) as static website hosting and CD.
45-
It's integrated into our pull requests: if `docs/` directory has changes Netlify
46-
will trigger website rebuild and deploy it's preview for a branch. You can view
47-
it to ensure that everything ok.
38+
We use GitHub Pages as static website hosting and CD.
4839

49-
Netlify deploys the website to production after merging anything to a `master` branch.
40+
GitHub deploys the website to production after merging anything to a `master` branch.
5041

5142
## Local Testing
5243

@@ -61,16 +52,10 @@ And navigate to `http://localhost:8000` after successful Gatsby build.
6152
There is no need to restart Gatsby server almost for all changes: it supports hot reload.
6253
Also, there is no need to refresh a webpage: hot reload updates changed content on the open page.
6354

64-
## Trigger Website Rebuild
55+
## Website Build
6556

66-
Currently, Netlify triggers rebuild only if anything has changes in `docs/` directory.
67-
But we can add a new linter and need to change a documentation to list the linter.
68-
69-
To do it run
57+
To do it run:
7058

7159
```sh
72-
go run ./scripts/expand_website_templates/main.go -only-state
60+
go run ./scripts/expand_website_templates/main.go
7361
```
74-
75-
It saves a hash of template replacements (that include all linters, configs, etc)
76-
into `docs/template_data.state`.

docs/src/docs/contributing/workflow.mdx

+4-14
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ title: Contributing Workflow
44

55
# Contributing
66

7-
By participating to this project, you agree to abide our [code of
8-
conduct](https://github.com/golangci/golangci-lint/blob/master/CODE_OF_CONDUCT.md).
7+
By participating in this project, you agree to abide our [code of conduct](https://github.com/golangci/golangci-lint/blob/master/CODE_OF_CONDUCT.md).
98

10-
## Setup your machine
9+
## Set up your machine
1110

1211
`golangci-lint` is written in [Go](https://go.dev).
1312

@@ -46,8 +45,7 @@ Push your branch to your `golangci-lint` fork and open a pull request against th
4645

4746
## Pull request checks
4847

49-
First, please, accept [CLA](https://gist.github.com/jirfag/26a39fd375da84b2d5ad4296fecb0668) - [cla assistant](https://cla-assistant.io/) will
50-
make a comment on the pull request about it.
48+
First, please, accept [CLA](https://gist.github.com/jirfag/26a39fd375da84b2d5ad4296fecb0668) - [cla assistant](https://cla-assistant.io/) will make a comment on the pull request about it.
5149

5250
Also, we run a few checks in CI by using GitHub actions, you can see them [here](https://github.com/golangci/golangci-lint/blob/master/.github/workflows/pr.yml).
5351

@@ -61,19 +59,11 @@ A GitHub action [workflow](https://github.com/golangci/golangci-lint/blob/master
6159
After making a release you need to update:
6260

6361
1. GitHub [action config](https://github.com/golangci/golangci-lint/blob/master/assets/github-action-config.json) by running:
64-
6562
```sh
6663
make assets/github-action-config.json
6764
```
6865

69-
2. The latest netlify state (e.g. docs/template_date.state):
70-
71-
```sh
72-
make update_netlify_state
73-
```
74-
75-
3. Contributors list
76-
66+
2. Contributors list:
7767
```sh
7868
make update_contributors_list # may take 15 min
7969
```

docs/static/CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
golangci-lint.run

docs/template_data.state

-2
This file was deleted.

netlify.toml

-23
This file was deleted.

scripts/expand_website_templates/main.go

+1-35
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ package main
22

33
import (
44
"bytes"
5-
"crypto/sha256"
6-
"encoding/hex"
75
"encoding/json"
8-
"flag"
96
"fmt"
107
"io"
118
"log"
@@ -29,48 +26,17 @@ import (
2926

3027
const listItemPrefix = "list-item-"
3128

32-
var stateFilePath = filepath.Join("docs", "template_data.state")
33-
3429
func main() {
35-
var onlyWriteState bool
36-
flag.BoolVar(&onlyWriteState, "only-state", false, fmt.Sprintf("Only write hash of state to %s and exit", stateFilePath))
37-
flag.Parse()
38-
3930
replacements, err := buildTemplateContext()
4031
if err != nil {
4132
log.Fatalf("Failed to build template context: %s", err)
4233
}
4334

44-
if err = updateStateFile(replacements); err != nil {
45-
log.Fatalf("Failed to update state file: %s", err)
46-
}
47-
48-
if onlyWriteState {
49-
return
50-
}
51-
5235
if err := rewriteDocs(replacements); err != nil {
5336
log.Fatalf("Failed to rewrite docs: %s", err)
5437
}
55-
log.Print("Successfully expanded templates")
56-
}
5738

58-
func updateStateFile(replacements map[string]string) error {
59-
replBytes, err := json.Marshal(replacements)
60-
if err != nil {
61-
return fmt.Errorf("failed to json marshal replacements: %w", err)
62-
}
63-
64-
h := sha256.New()
65-
if _, err := h.Write(replBytes); err != nil {
66-
return err
67-
}
68-
69-
contentBuf := bytes.NewBufferString("This file stores hash of website templates to trigger " +
70-
"Netlify rebuild when something changes, e.g. new linter is added.\n")
71-
contentBuf.WriteString(hex.EncodeToString(h.Sum(nil)))
72-
73-
return renameio.WriteFile(stateFilePath, contentBuf.Bytes(), os.ModePerm)
39+
log.Print("Successfully expanded templates")
7440
}
7541

7642
func rewriteDocs(replacements map[string]string) error {

0 commit comments

Comments
 (0)