Skip to content

fix: prevent unnecessary updates when cpu_options is unset (#4806) #1599

fix: prevent unnecessary updates when cpu_options is unset (#4806)

fix: prevent unnecessary updates when cpu_options is unset (#4806) #1599

Workflow file for this run

name: Update docs
on:
push:
paths:
- "**/*.tf"
- "**/*.md"
- ".github/workflows/update-docs.yml"
permissions:
contents: read
jobs:
docs:
name: Auto update terraform docs
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout with GITHUB Action token
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
# use an app to ensure CI is triggered
- name: Generate TF docs
if: github.repository_owner == 'github-aws-runners'
uses: terraform-docs/gh-actions@6de6da0cefcc6b4b7a5cbea4d79d97060733093c # v1.4.1
with:
find-dir: .
git-commit-message: "docs: auto update terraform docs"
git-push: ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'github-aws-runners' }}
git-push-user-name: github-aws-runners-pr|bot
git-push-user-email: "github-aws-runners-pr[bot]@users.noreply.github.com"
- name: Generate TF docs (forks)
if: github.repository_owner != 'github-aws-runners'
uses: terraform-docs/gh-actions@6de6da0cefcc6b4b7a5cbea4d79d97060733093c # v1.4.1
with:
find-dir: .
git-commit-message: "docs: auto update terraform docs"
git-push: ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'github-aws-runners' }}
# change docs via PR in case of locked main branch
- name: Create Pull Request (main branch only)
if: github.ref == 'refs/heads/main' && github.repository_owner == 'github-aws-runners'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: auto update terraform docs"
title: "docs: Update Terraform docs"
branch: update-docs
branch-suffix: random
base: ${{ github.event.pull_request.base.ref }}
delete-branch: true
deploy-pages:
needs: [docs]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install --require-hashes -r .github/workflows/mkdocs/requirements.txt
- name: Build and deploy docs (main branch)
if: github.ref == 'refs/heads/main'
run: mkdocs gh-deploy --force -c -b gh-pages
- name: Build docs only (other branches)
if: github.ref != 'refs/heads/main'
run: mkdocs build