Compare commits
5 Commits
64fc7025ad
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 204487f6d7 | |||
| dff2f06016 | |||
| ffce332e84 | |||
| 8f25ef93a5 | |||
| 6863c0469f |
+2
-3
@@ -1,6 +1,6 @@
|
|||||||
FROM node:24-bookworm-slim
|
FROM node:24-bookworm-slim
|
||||||
|
|
||||||
ARG HUGO_VERSION=0.146.4
|
ARG HUGO_VERSION=0.163.2
|
||||||
ARG TARGETARCH=arm64
|
ARG TARGETARCH=arm64
|
||||||
|
|
||||||
RUN apt-get update -qq && \
|
RUN apt-get update -qq && \
|
||||||
@@ -8,8 +8,8 @@ RUN apt-get update -qq && \
|
|||||||
git \
|
git \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
golang \
|
golang \
|
||||||
lftp \
|
|
||||||
openssh-client \
|
openssh-client \
|
||||||
|
rclone \
|
||||||
wget \
|
wget \
|
||||||
&& \
|
&& \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
@@ -19,4 +19,3 @@ RUN wget -q -O /tmp/hugo.deb \
|
|||||||
dpkg -i /tmp/hugo.deb && \
|
dpkg -i /tmp/hugo.deb && \
|
||||||
rm /tmp/hugo.deb
|
rm /tmp/hugo.deb
|
||||||
|
|
||||||
RUN npm install -g yarn
|
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Hugo runner
|
||||||
|
|
||||||
|
## Update image
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t git.nortelli.fr/erwan/hugo:latest .
|
||||||
|
docker login git.nortelli.fr
|
||||||
|
docker push git.nortelli.fr/erwan/hugo:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## Setup Gitea runner
|
||||||
|
|
||||||
|
Update `act_runner/config.yaml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
runner:
|
||||||
|
labels:
|
||||||
|
- "hugo:docker://git.nortelli.fr/erwan/hugo:latest"
|
||||||
|
|
||||||
|
container:
|
||||||
|
network: "<runner-network>"
|
||||||
|
|
||||||
|
cache:
|
||||||
|
enabled: true
|
||||||
|
host: "<runner-container-name>"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Use image
|
||||||
|
|
||||||
|
Add registry secrets in https://git.nortelli.fr/user/settings/actions/secrets:
|
||||||
|
|
||||||
|
- `REGISTRY_USER`: your username
|
||||||
|
- `REGISTRY_TOKEN`: a [token](https://git.nortelli.fr/user/settings/applications) with `package: read`
|
||||||
|
|
||||||
|
Setup a Gitea workflow:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build-deploy:
|
||||||
|
runs-on: hugo
|
||||||
|
env:
|
||||||
|
HUGO_CACHEDIR: /tmp/hugo_cache
|
||||||
|
HUGO_ENVIRONMENT: production
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.cache/yarn
|
||||||
|
key: yarn-${{ hashFiles('yarn.lock') }}
|
||||||
|
restore-keys: yarn-
|
||||||
|
|
||||||
|
- run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.HUGO_CACHEDIR }}
|
||||||
|
key: hugo-${{ hashFiles('go.sum') }}
|
||||||
|
restore-keys: hugo-
|
||||||
|
|
||||||
|
- run: hugo --noChmod --gc --minify
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user