diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 9272d79df..2904fa225 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -25,13 +25,26 @@ on: push: branches: - main # Set a branch to deploy + schedule: - cron: "0 3 * * *" + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +defaults: + run: + shell: bash + env: # ---------------------------------------------------------------------------- # Specify the deployment environment: staging or production - hugoEnvironment: production + HUGO_ENVIRONMENT: staging + HUGO_VERSION: 0.133.1 jobs: # ---------------------------------------------------------------------------- @@ -42,6 +55,7 @@ jobs: outputs: zoteroVersion: ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }} cacheHit: ${{ steps.cache-zotero-bib.outputs.cache-hit }} + runs-on: ubuntu-latest concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -66,19 +80,18 @@ jobs: ${{ fromJson(steps.zoteroVersion.outputs.headers).last-modified-version }} # ---------------------------------------------------------------------------- - # Deploy the website. This job is conditional, we will always run it on a + # Build the website. This job is conditional, we will always run it on a # push or if on a scheduled run the cache was determined to be out of date. # - deploy: + build: needs: check runs-on: ubuntu-latest if: github.event_name == 'push' || needs.check.outputs.cacheHit != 'true' steps: - - uses: actions/setup-go@v5 - with: - go-version: '1.18.1' - - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 - name: Cache Zotero Bibliography id: cache-zotero-bib @@ -106,13 +119,17 @@ jobs: ./update_bibliography.sh sudo cp --recursive ${GITHUB_WORKSPACE}/static/data ~/data fi - shell: bash - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: '0.133.1' - extended: true + # Install Hugo Extended + # + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 - name: Setup Node uses: actions/setup-node@v4 @@ -124,12 +141,26 @@ jobs: - run: npm install --verbose - name: Build - run: hugo -e $hugoEnvironment -d ~/temp/deploy + env: +# HUGO_ENVIRONMENT: staging + HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache + TZ: America/New York + run: hugo -d "./public" --cleanDestinationDir -e staging + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./public + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build -# - name: Deploy -# uses: peaceiris/actions-gh-pages@v4 -# if: github.ref == 'refs/heads/main' -# with: -# github_token: ${{ secrets.GITHUB_TOKEN }} -# publish_dir: ./public + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/.gitignore b/.gitignore index b41f2aa34..3ad067183 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ _site .sass-cache .jekyll-metadata -public/ node_modules/ _gen/ .hugo_build.lock diff --git a/config/_default/hugo.yaml b/config/_default/hugo.yaml index 7e625d5e8..f3a589831 100644 --- a/config/_default/hugo.yaml +++ b/config/_default/hugo.yaml @@ -17,7 +17,7 @@ canonifyURLs: false # Default to false and set to true for production in config/production/hugo.yaml enableRobotsTXT: false -# aasetDir: Location where Hugo looks for assets +# assetDir: Location where Hugo looks for assets assetDir: static # Enable .GitInfo object for each page. This will give values to .Lastmod etc. diff --git a/config/_default/markup.yaml b/config/_default/markup.yaml index 4b348b3fc..01caed2c5 100644 --- a/config/_default/markup.yaml +++ b/config/_default/markup.yaml @@ -14,7 +14,7 @@ goldmark: # See: https://gohugo.io/getting-started/configuration-markup/#highlight # for additional information on configuration options. # https://www.docsy.dev/docs/adding-content/lookandfeel/#code-highlighting-with-chroma -# contains Docsy specfiic code highlighting information +# contains Docsy specfic code highlighting information highlight: # See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html #style: solarized-dark diff --git a/config/_default/params.yaml b/config/_default/params.yaml index 759ed2d31..1e6030e2c 100644 --- a/config/_default/params.yaml +++ b/config/_default/params.yaml @@ -53,7 +53,7 @@ github_branch: main github_subdir: github_project_repo: https://github.com/interlisp/medley -# Google custom seach engine configuration +# Google custom search engine configuration # gcs_engine_id: search engine gcs_engine_id: 33ef4cbe0703b4f3a diff --git a/config/_default/privacy.yaml b/config/_default/privacy.yaml index 527ab0b56..0c4f9e895 100644 --- a/config/_default/privacy.yaml +++ b/config/_default/privacy.yaml @@ -5,7 +5,7 @@ # See: https://gohugo.io/about/hugo-and-gdpr/ # # googleAnalytics: -# ananymizIP: Enable anonymiation of IP addresses +# ananymizeIP: Enable anonymization of IP addresses # disable: Set to true to disable googleAnalytics # respectDoNotTrack: Check for Do Not Track in headers # useSessionStorage: Store session information in storage and diff --git a/config/staging/hugo.yaml b/config/staging/hugo.yaml index dcf0c6a77..904e9b617 100644 --- a/config/staging/hugo.yaml +++ b/config/staging/hugo.yaml @@ -1,4 +1,8 @@ -baseURL: https://wasm.interlisp.org +baseURL: https://stumbo.github.io/InterlispDraft.github.io/ + languageCode: en-us + +# title +# Insert Staging Environment onto every page to make clear +# this is not the production site title: 'Staging Environment' -publishDir: stage