Skip to content

Commit

Permalink
Update build, hugo and nginx. (#1190)
Browse files Browse the repository at this point in the history
* build: Update GitHub actions.

* docker: Use nginx 1.26 (latest stable)

* build: Update testing tools.

* build: Update to hugo 0.134.0

- Add a trailing slash to baseURL as expected by the new hugo version.
- Use the newer css.Sass instead of deprecated resources.ToCSS
  • Loading branch information
jholdstock authored Sep 5, 2024
1 parent 2ec9c56 commit babba20
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Tests
run: ./bin/test.sh
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build the Docker image
run: docker build -t decred/dcrweb:$(date +%s) .
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
FROM alpine:latest

ARG HUGO_BASEURL
ENV HUGO_BASEURL ${HUGO_BASEURL:-https://decred.org}
ENV HUGO_VERSION 0.110.0
ENV HUGO_BASEURL ${HUGO_BASEURL:-https://decred.org/}
ENV HUGO_VERSION 0.134.0

LABEL description="gohugo build"
LABEL version="1.0"
Expand All @@ -25,7 +25,7 @@ RUN bin/build-hugo.sh
# Serve image (stable nginx version)
# This cannot use Alpine because test/Dockerfile builds on this image and
# expects it to have apt-get.
FROM nginx:1.22
FROM nginx:1.26

LABEL description="dcrweb server"
LABEL version="1.0"
Expand Down
2 changes: 1 addition & 1 deletion bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ docker stop validator 2>/dev/null
docker run \
-d --rm \
--name validator \
-p 8888:8888 ghcr.io/validator/validator:21.7.10 || exit 1
-p 8888:8888 ghcr.io/validator/validator:23.4.11 || exit 1

# wait for the validator service to start up

Expand Down
2 changes: 1 addition & 1 deletion bin/watch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ ${HUGO} server \
--buildDrafts \
--disableFastRender \
--source src \
--baseURL http://localhost:1313
--baseURL http://localhost:1313/
2 changes: 1 addition & 1 deletion src/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<!-- Compile and load scss. -->
{{ $scssOptions := (dict "targetPath" "decred-v6.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $v6Style := resources.Get "scss/decred-v6.scss" | resources.ToCSS $scssOptions | resources.Fingerprint }}
{{ $v6Style := resources.Get "scss/decred-v6.scss" | css.Sass $scssOptions | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $v6Style.Permalink }}" integrity="{{ $v6Style.Data.Integrity }}">

<!-- Custom favicon -->
Expand Down
4 changes: 2 additions & 2 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ RUN apt-get update && apt-get install -y curl
COPY package.json run-test.sh ./

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION v14
ENV NODE_VERSION v20

RUN mkdir -p $NVM_DIR && \
curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# install node and npm
RUN . $NVM_DIR/nvm.sh \
Expand Down

0 comments on commit babba20

Please sign in to comment.