From 25f9810826bfa32ec85b0bbf82397dcbad7c67de Mon Sep 17 00:00:00 2001 From: Scott Dyer Date: Fri, 13 Feb 2026 21:15:43 -0800 Subject: [PATCH 1/2] Update and build workflow to fix "client version too old" issue and address deprecation warnings Simplify checkout step Update deployment logic to switch and copy method Signed-off-by: Scott Dyer --- .github/workflows/main.yml | 83 ++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1ae0563..35f5181 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,65 +4,62 @@ on: branches: - dev - main + jobs: docker: - name: Build Mkdocs site from docker container + name: Build Mkdocs site runs-on: ubuntu-latest steps: - - name: Checkout dev branch - if: endsWith(github.ref, '/dev') - uses: actions/checkout@v2 - with: - ref: dev - fetch-depth: 0 - - name: Checkout main branch - if: endsWith(github.ref, '/main') - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4 with: - ref: main fetch-depth: 0 - - name: Setup git config - run: | - git config user.name "GitHub Actions Bot" - git config user.email "<>" - - name: Build docker image + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build local docker image uses: docker/build-push-action@v2 with: context: . - push: false + load: true tags: app:latest + - name: Run mkdocs build via docker uses: addnab/docker-run-action@v3 with: image: app:latest - options: --rm -v ${{ github.workspace }}:/docs -v ${{ github.workspace }}/site:/site + options: --rm -v ${{ github.workspace }}:/docs run: | - git config --global --add safe.directory /docs; - mkdocs build; - - name: Commit dev updates to site/staging branch + git config --global --add safe.directory /docs + mkdocs build + + - name: Deploy to site/staging (from dev) if: endsWith(github.ref, '/dev') run: | - sudo chown -R runner:docker site; - git stash -u; - git fetch; - git switch site/staging; - rm -rf site; - git clean -d -x -f; - git stash pop; - git add .; - git commit -m 'Gitbot actions site change'; - git push origin; - - name: Commit main updates to site/production branch + git config user.name "Github Actions Bot" + git config user.email "<>" + sudo chown -R $USER:$USER site + git fetch origin site/staging + git switch site/staging + rm -rf ./* + cp -r site/* . + rm -rf site + git add . + git commit -m "Deploy dev build to staging" + git push origin site/staging + + - name: Deploy to site/production (from main) if: endsWith(github.ref, '/main') run: | - sudo chown -R runner:docker site; - git stash -u; - git fetch; - git switch site/production; - rm -rf site; - git clean -d -x -f; - git stash pop; - git add .; - git commit -m 'Gitbot actions site change'; - git push origin; - + git config user.name "Github Actions Bot" + git config user.email "<>" + sudo chown -R $USER:$USER site + git fetch origin site/production + git switch site/production + rm -rf ./* + cp -r site/* . + rm -rf site + git add . + git commit -m "Deploy main build to production" + git push origin site/production From 687a9cc33472b1dde175945473967dbe97ff2a0c Mon Sep 17 00:00:00 2001 From: Scott Dyer Date: Fri, 13 Feb 2026 21:29:29 -0800 Subject: [PATCH 2/2] Update workflow to remove docker API entirely Signed-off-by: Scott Dyer --- .github/workflows/main.yml | 84 ++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 49 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35f5181..0e36672 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,65 +1,51 @@ -name: Build Mkdocs Site +name: Build and Deploy MkDocs on: push: branches: - dev - main +permissions: + contents: write + jobs: - docker: - name: Build Mkdocs site + deploy: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout Code uses: actions/checkout@v4 with: - fetch-depth: 0 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + fetch-depth: 0 - - name: Build local docker image - uses: docker/build-push-action@v2 + - name: Setup Python + uses: actions/setup-python@v5 with: - context: . - load: true - tags: app:latest + python-version: '3.10' + cache: 'pip' - - name: Run mkdocs build via docker - uses: addnab/docker-run-action@v3 - with: - image: app:latest - options: --rm -v ${{ github.workspace }}:/docs - run: | - git config --global --add safe.directory /docs - mkdocs build - - - name: Deploy to site/staging (from dev) - if: endsWith(github.ref, '/dev') + - name: Install dependencies run: | - git config user.name "Github Actions Bot" - git config user.email "<>" - sudo chown -R $USER:$USER site - git fetch origin site/staging - git switch site/staging - rm -rf ./* - cp -r site/* . - rm -rf site - git add . - git commit -m "Deploy dev build to staging" - git push origin site/staging + python -m pip install --upgrade pip + pip install mkdocs mkdocs-material + pip install -r requirements.txt - - name: Deploy to site/production (from main) - if: endsWith(github.ref, '/main') - run: | - git config user.name "Github Actions Bot" - git config user.email "<>" - sudo chown -R $USER:$USER site - git fetch origin site/production - git switch site/production - rm -rf ./* - cp -r site/* . - rm -rf site - git add . - git commit -m "Deploy main build to production" - git push origin site/production + - name: Build MkDocs + run: mkdocs build + + - name: Deploy to Staging (from dev) + if: github.ref == 'refs/heads/dev' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site + publish_branch: site/staging + commit_message: "Deploy dev build to staging" + + - name: Deploy to Production (from main) + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site + publish_branch: site/production + commit_message: "Deploy main build to production" \ No newline at end of file