Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Nov 22, 2023
1 parent 25c0462 commit a1391b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
tags: ghcr.io/hbstack/site:latest,ghcr.io/hbstack/site:${{ github.sha }}
build-args: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
NETRC_USERNAME=${{ secrets.NETRC_GITHUB_USERNAME }}
NETRC_PASSWORD=${{ secrets.NETRC_GITHUB_PASSWORD }}
- uses: azure/setup-kubectl@v3
id: install
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/cloudflare-page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: extractions/netrc@v1
with:
machine: github.com
username: ${{ secrets.NETRC_GITHUB_USERNAME }}
password: ${{ secrets.NETRC_GITHUB_PASSWORD }}

# - name: Cache dependencies
# uses: actions/cache@v3
# with:
Expand Down Expand Up @@ -49,6 +43,8 @@ jobs:
cp public/en/404.html public/404.html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETRC_USERNAME: ${{ secrets.NETRC_GITHUB_USERNAME }}
NETRC_PASSWORD: ${{ secrets.NETRC_GITHUB_PASSWORD }}

- name: Publish English Site to Cloudflare Pages
uses: cloudflare/pages-action@v1
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
FROM hugomods/hugo:exts as builder
ARG GITHUB_TOKEN
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
ARG NETRC_USERNAME
ENV NETRC_USERNAME=${NETRC_USERNAME}
ARG NETRC_PASSWORD
ENV NETRC_PASSWORD=${NETRC_PASSWORD}
# Base URL
ARG HUGO_BASEURL=
ENV HUGO_BASEURL=${HUGO_BASEURL}
Expand All @@ -12,6 +16,7 @@ ARG HUGO_MODULE_PROXY=
ENV HUGO_MODULE_PROXY=${HUGO_MODULE_PROXY}
# Build site
COPY . /src
RUN printf "machine github.com\nlogin $NETRC_USERNAME\npassword $NETRC_PASSWORD" >> $HOME/.netrc
RUN hugo --minify --gc --enableGitInfo

###############
Expand Down

0 comments on commit a1391b5

Please sign in to comment.