Skip to content

Commit

Permalink
chore: add Hugo caching (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
aepfli committed Mar 2, 2023
1 parent 72d3c9e commit b2f24fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/htmltest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ jobs:
uses: actions/cache@v3
with:
path: |
tmp/.htmltest
docs/tmp/.htmltest
key: ${{ runner.os }}-htmltest

- name: Cache Hugo packages
uses: actions/cache@v3
with:
path: |
docs/tmp/.hugo
key: ${{ runner.os }}-hugo

- name: Check HTML
run: make htmltest
11 changes: 6 additions & 5 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ VOLUMES := -v $(ROOT_DIR):/src
HUGO_VERSION := 0.105.0-ext
IMAGE := klakegg/hugo:$(HUGO_VERSION)
PORT := 1314
DOCKER_CMD := docker run --rm -t -e HUGO_CACHEDIR=/src/tmp/.hugo

.PHONY: build server clean shell htmltest

build:
docker run --rm -t $(VOLUMES) $(IMAGE) -D -v
$(DOCKER_CMD) $(VOLUMES) $(IMAGE) -D -v

shell:
docker run --rm -it $(VOLUMES) $(IMAGE) shell
$(DOCKER_CMD) -i $(VOLUMES) $(IMAGE) shell

server:
docker run --rm -t $(VOLUMES) -p $(PORT):$(PORT) $(IMAGE) server -D -p $(PORT)
$(DOCKER_CMD) $(VOLUMES) -p $(PORT):$(PORT) $(IMAGE) server -D -p $(PORT)

clean:
docker run --rm -t $(VOLUMES) $(IMAGE) --cleanDestinationDir
$(DOCKER_CMD) $(VOLUMES) $(IMAGE) --cleanDestinationDir

htmltest: build
docker run --rm -t -v $(ROOT_DIR):/test wjdp/htmltest -c .htmltest.yml public
$(DOCKER_CMD) -v $(ROOT_DIR):/test wjdp/htmltest -c .htmltest.yml public

0 comments on commit b2f24fe

Please sign in to comment.