Skip to content

Commit aba50d2

Browse files
committed
Fix build
1 parent 25c0462 commit aba50d2

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/ci-cd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
tags: ghcr.io/hbstack/site:latest,ghcr.io/hbstack/site:${{ github.sha }}
3434
build-args: |
3535
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
36+
NETRC_USERNAME=${{ secrets.NETRC_GITHUB_USERNAME }}
37+
NETRC_PASSWORD=${{ secrets.NETRC_GITHUB_PASSWORD }}
3638
3739
- uses: azure/setup-kubectl@v3
3840
id: install

.github/workflows/cloudflare-page.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
1818

19-
- uses: extractions/netrc@v1
20-
with:
21-
machine: github.com
22-
username: ${{ secrets.NETRC_GITHUB_USERNAME }}
23-
password: ${{ secrets.NETRC_GITHUB_PASSWORD }}
24-
2519
# - name: Cache dependencies
2620
# uses: actions/cache@v3
2721
# with:
@@ -45,10 +39,13 @@ jobs:
4539
options: -v ${{ github.workspace }}:/src -e GITHUB_TOKEN
4640
run: >-
4741
git config --global --add safe.directory /src &&
42+
printf "machine github.com\nlogin $NETRC_USERNAME\npassword $NETRC_PASSWORD" >> ~/.netrc &&
4843
hugo --minify --gc --enableGitInfo &&
4944
cp public/en/404.html public/404.html
5045
env:
5146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NETRC_USERNAME: ${{ secrets.NETRC_GITHUB_USERNAME }}
48+
NETRC_PASSWORD: ${{ secrets.NETRC_GITHUB_PASSWORD }}
5249

5350
- name: Publish English Site to Cloudflare Pages
5451
uses: cloudflare/pages-action@v1

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
FROM hugomods/hugo:exts as builder
55
ARG GITHUB_TOKEN
66
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
7+
ARG NETRC_USERNAME
8+
ENV NETRC_USERNAME=${NETRC_USERNAME}
9+
ARG NETRC_PASSWORD
10+
ENV NETRC_PASSWORD=${NETRC_PASSWORD}
711
# Base URL
812
ARG HUGO_BASEURL=
913
ENV HUGO_BASEURL=${HUGO_BASEURL}
@@ -12,6 +16,7 @@ ARG HUGO_MODULE_PROXY=
1216
ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}
1317
# Build site
1418
COPY . /src
19+
RUN printf "machine github.com\nlogin $NETRC_USERNAME\npassword $NETRC_PASSWORD" >> $HOME/.netrc
1520
RUN hugo --minify --gc --enableGitInfo
1621

1722
###############

0 commit comments

Comments
 (0)