From 66b2f8051292807149308184db8067fcca6791d8 Mon Sep 17 00:00:00 2001 From: Michael McKeen Date: Fri, 3 Oct 2025 09:05:32 -0400 Subject: [PATCH 1/2] ExampleSite: Configure to deploy to GH Pages --- .github/workflows/example-site-deploy.yml | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/example-site-deploy.yml diff --git a/.github/workflows/example-site-deploy.yml b/.github/workflows/example-site-deploy.yml new file mode 100644 index 00000000..2748ee0f --- /dev/null +++ b/.github/workflows/example-site-deploy.yml @@ -0,0 +1,55 @@ +name: Deploy Example Site (GH Pages) +env: + GO_VERSION: "1.23" + HUGO_VERSION: "0.147.8" + GH_PAGES_URL: https://nginxinc.github.io/nginx-hugo-theme + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Cancel any in-prog deployments if a newer push comes in. +concurrency: + group: example-site-deploy + cancel-in-progress: true + +jobs: + build-deploy: + environment: + name: example-site + url: ${{ steps.deploy.outputs.page_url }} + runs-on: ubuntu-22.04 + steps: + - name: Setup Go + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 #v6.0.0 + with: + go-version: ${{ env.GO_VERSION }} + cache: false + - name: Setup Hugo + uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f #v3.0.0 + with: + hugo-version: ${{ env.HUGO_VERSION }} + extended: true + - name: Checkout repo + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0 + with: + fetch-depth: 0 + - name: Build exampleSite + working-directory: exampleSite + run: hugo --gc -e production --baseURL="$GH_PAGES_URL" + - name: Upload artifact + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b #v4 + with: + path: exampleSite/public + - name: Deploy artifact to GH Pages + id: deploy + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e #v4.0.5 + + From 6e7aa08e7d6a6b627e5f695e04d8fb67b8acd899 Mon Sep 17 00:00:00 2001 From: Michael McKeen Date: Fri, 3 Oct 2025 13:38:12 -0400 Subject: [PATCH 2/2] ExampleSite: Adjust workflow trigger to published releases --- .github/workflows/example-site-deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/example-site-deploy.yml b/.github/workflows/example-site-deploy.yml index 2748ee0f..b009751a 100644 --- a/.github/workflows/example-site-deploy.yml +++ b/.github/workflows/example-site-deploy.yml @@ -5,9 +5,9 @@ env: GH_PAGES_URL: https://nginxinc.github.io/nginx-hugo-theme on: - push: - branches: - - main + release: + types: + - published workflow_dispatch: permissions: