Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build-auto-generated-files-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Build Auto-Generated Files
on:
workflow_call:
inputs:
baseSha:
type: string
required: false
buildAll:
type: boolean
required: false
default: false
secrets:
ADP_DEVSITE_APP_ID:
required: true
ADP_DEVSITE_APP_PRIVATE_KEY:
required: true

jobs:
build-contributors:
name: Build Contributors
if: github.repository != 'AdobeDocs/dev-docs-template'
uses: ./.github/workflows/build-contributors-v2.yml
with:
baseSha: ${{ inputs.baseSha }}
buildAll: ${{ inputs.buildAll }}
secrets: inherit

build-site-metadata:
name: Build Site Metadata
needs: build-contributors
if: |
always() &&
github.repository != 'AdobeDocs/dev-docs-template'
uses: ./.github/workflows/build-site-metadata-v2.yml
secrets: inherit
47 changes: 47 additions & 0 deletions .github/workflows/build-contributors-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Build Contributors
on:
workflow_call:
inputs:
baseSha:
type: string
required: false
buildAll:
type: boolean
required: false
default: false

jobs:
build-contributors:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0

- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.ADP_DEVSITE_APP_ID }}
private-key: ${{ secrets.ADP_DEVSITE_APP_PRIVATE_KEY }}

- name: Build Contributors
run: npx --yes github:AdobeDocs/adp-devsite-utils buildContributorsV2 -v ${{ inputs.buildAll && '--all' || '' }}
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
BASE_SHA: ${{ inputs.baseSha || github.event.before }}

- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}
git add src/pages/contributors.json
git pull
git diff --cached --quiet || git commit -m "chore: auto-generate contributors"
git push
35 changes: 35 additions & 0 deletions .github/workflows/build-site-metadata-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Build Site Metadata
on:
workflow_call:

jobs:
build-site-metadata:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.ADP_DEVSITE_APP_ID }}
private-key: ${{ secrets.ADP_DEVSITE_APP_PRIVATE_KEY }}

- name: Build Site Metadata
run: npx --yes github:AdobeDocs/adp-devsite-utils buildSiteMetadata -v

- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}
git add src/pages/adp-site-metadata.json
git pull
git diff --cached --quiet || git commit -m "chore: auto-generate site metadata"
git push
Loading