This commit is contained in:
parent
7accb7b1fc
commit
80cbb6f32a
1 changed files with 8 additions and 5 deletions
|
|
@ -37,22 +37,25 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
# 1. Create the cache and force it to be writable by the Docker container
|
|
||||||
mkdir -p "$PWD/.hugo-cache"
|
mkdir -p "$PWD/.hugo-cache"
|
||||||
chmod -R 777 "$PWD/.hugo-cache"
|
chmod -R 777 "$PWD/.hugo-cache"
|
||||||
|
|
||||||
# 2. Run Hugo
|
# We pass the Git config as an environment variable to bypass the 'dubious ownership'
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "$PWD:/src" \
|
-v "$PWD:/src" \
|
||||||
-v "$PWD/.hugo-cache:/cache" \
|
-v "$PWD/.hugo-cache:/cache" \
|
||||||
-e GOPATH=/cache \
|
-e GOPATH=/cache \
|
||||||
-e HUGO_CACHEDIR=/cache \
|
-e HUGO_CACHEDIR=/cache \
|
||||||
|
-e GIT_CONFIG_COUNT=1 \
|
||||||
|
-e GIT_CONFIG_KEY_0=safe.directory \
|
||||||
|
-e GIT_CONFIG_VALUE_0=/src \
|
||||||
-w /src/site \
|
-w /src/site \
|
||||||
forgejo.jmopines.com/jm/hugo-git:latest \
|
forgejo.jmopines.com/jm/hugo-git:latest \
|
||||||
--minify --enableGitInfo --destination "public" --baseURL "/"
|
--minify --enableGitInfo --noTimes --destination "public" --baseURL "/"
|
||||||
|
|
||||||
# 3. Fix permissions back so the forgejo user can read the output
|
# Ensure the forgejo user owns the output so rsync can read it
|
||||||
sudo chmod -R 755 site/public
|
# (Docker root often leaves files owned by root)
|
||||||
|
sudo chown -R forgejo:forgejo site/public
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue