diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ac94e4297517..595bdb79d5a9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,8 +8,17 @@ on: - 'docs/user/**' jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v1 + - name: Build Website + run: | + docker run -v ${PWD}/sources:/hugo/content/docs/grafana-cloud --rm grafana/docs-base:latest /bin/bash -c 'make hugo' sync: runs-on: ubuntu-latest + needs: test steps: - uses: actions/checkout@v1 - run: git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000000..3670a1f81a91 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,11 @@ +IMAGE = grafana/docs-base:latest +CONTENT_PATH = /hugo/content/docs/agent/latest +PORT = 3002:3002 + +.PHONY: pull +pull: + docker pull $(IMAGE) + +.PHONY: docs +docs: pull + docker run -v $(shell pwd)/user:$(CONTENT_PATH):Z -p $(PORT) --rm -it $(IMAGE) diff --git a/docs/README.md b/docs/README.md index 155608a73c2b..1a901d38c27d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,3 +9,8 @@ parts: Github. * `developer/`: Documentation for contributors and maintainers. * `rfcs/`: RFCs for proposals relating to Grafana Agent. + +## Preview the website + +Run `make docs`. This launches a preview of the website with the current grafana docs at `http://localhost:3002/docs/agent/latest/` which will refresh automatically when changes are made to content in the `sources` directory. +Make sure Docker is running. \ No newline at end of file