This commit is contained in:
parent
b41603c6b3
commit
8aea75ef03
1 changed files with 11 additions and 10 deletions
|
|
@ -37,21 +37,22 @@ jobs:
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
mkdir -p "$PWD/.hugo-cache"
|
# 1. Create a permanent cache folder on the VM so it doesn't redownload every time
|
||||||
chmod -R 777 "$PWD/.hugo-cache"
|
mkdir -p /home/forgejo/hugo_cache
|
||||||
|
chmod 777 /home/forgejo/hugo_cache
|
||||||
|
|
||||||
docker run --rm \
|
# 2. Run with a 60-second timeout. If it takes longer, something is wrong.
|
||||||
|
# We add --network host to ensure the container can see the internet/local gitea
|
||||||
|
timeout 60s docker run --rm \
|
||||||
--entrypoint /bin/sh \
|
--entrypoint /bin/sh \
|
||||||
|
--network host \
|
||||||
-v "$PWD:/src" \
|
-v "$PWD:/src" \
|
||||||
-v "$PWD/.hugo-cache:/cache" \
|
-v "/home/forgejo/hugo_cache:/cache" \
|
||||||
-e GOPATH=/cache \
|
|
||||||
-e HUGO_CACHEDIR=/cache \
|
-e HUGO_CACHEDIR=/cache \
|
||||||
|
-e GOPATH=/cache \
|
||||||
-w /src/site \
|
-w /src/site \
|
||||||
forgejo.jmopines.com/jm/hugo-git:latest \
|
forgejo.jmopines.com/jm/hugo-git:latest \
|
||||||
-c "git config --global --add safe.directory /src && hugo --minify --enableGitInfo --noTimes --destination public --baseURL /"
|
-c "git config --global --add safe.directory /src && hugo --minify --enableGitInfo --noTimes --destination public"
|
||||||
|
|
||||||
# Ensure the host runner user can read the results for rsync
|
|
||||||
sudo chown -R forgejo:forgejo site/public || true
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
run: |
|
run: |
|
||||||
set -ex
|
set -ex
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue