Skip to content

Merge branch 'main' into fix-3950 #1

Merge branch 'main' into fix-3950

Merge branch 'main' into fix-3950 #1

Workflow file for this run

name: Update docs
on:
push:
paths:
- "**/*.tf"
- "**/*.md"
- ".github/workflows/update-docs.yml"
permissions:
contents: write
pull-requests: write
jobs:
docs:
# update docs after merge back to develop
name: Auto update terraform docs
runs-on: ubuntu-latest
steps:
- uses: philips-software/app-token-action@9f5d57062c9f2beaffafaa9a34f66f824ead63a9 # v2.0.0
id: app
with:
app_id: ${{ vars.FOREST_PR_BOT_APP_ID }}
app_base64_private_key: ${{ secrets.FOREST_PR_BOT_APP_KEY_BASE64 }}
auth_type: installation
org: philips-labs
- name: Checkout with GITHUB Action token
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # ratchet:actions/checkout@v4
with:
token: ${{ steps.app.outputs.token }}
# use an app to ensure CI is triggered
- name: Generate TF docs
if: github.repository_owner == 'philips-labs'
uses: terraform-docs/gh-actions@7a62208a0090636af2df1b739da46d27fd90bdc6 # ratchet:terraform-docs/gh-actions@v1.1.0
with:
find-dir: .
git-commit-message: "docs: auto update terraform docs"
git-push: ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'philips-labs' }}
git-push-user-name: forest-pr|bot
git-push-user-email: "forest-pr[bot]@users.noreply.github.com"
- name: Generate TF docs (forks)
if: github.repository_owner != 'philips-labs'
uses: terraform-docs/gh-actions@7a62208a0090636af2df1b739da46d27fd90bdc6 # ratchet:terraform-docs/gh-actions@v1.1.0
with:
find-dir: .
git-commit-message: "docs: auto update terraform docs"
git-push: ${{ github.ref != 'refs/heads/main' || github.repository_owner != 'philips-labs' }}
# 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 == 'philips-labs'
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # ratchet:peter-evans/create-pull-request@v6.0.5
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
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # ratchet:actions/checkout@v4
- 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@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: pip install mkdocs-material-extensions
- run: mkdocs gh-deploy --force -c -b gh-pages