File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 44FROM hugomods/hugo:exts as builder
55ARG GITHUB_TOKEN
66ENV 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
812ARG HUGO_BASEURL=
913ENV HUGO_BASEURL=${HUGO_BASEURL}
@@ -12,6 +16,7 @@ ARG HUGO_MODULE_PROXY=
1216ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}
1317# Build site
1418COPY . /src
19+ RUN printf "machine github.com\n login $NETRC_USERNAME\n password $NETRC_PASSWORD" >> $HOME/.netrc
1520RUN hugo --minify --gc --enableGitInfo
1621
1722# ##############
You can’t perform that action at this time.
0 commit comments