Skip to content
Merged
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
64 changes: 64 additions & 0 deletions .github/workflows/docs-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# When we push a new tag to the repository, open a Pull Request to synchronize
# the API reference and other documentation with the "docs" repository.

name: "Update docs"

concurrency:
group: "ci-${{ github.ref_name }}"
cancel-in-progress: true

on:
push:
tags:
- 'v*'

jobs:
push-api-docs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout 'fabric' repository"
uses: "actions/checkout@v4"
with:
fetch-depth: 0
persist-credentials: "false"

- name: "Checkout 'docs' repository"
uses: "actions/checkout@v4"
with:
repository: "githedgehog/docs"
path: "project_documentation"
persist-credentials: "false"

- name: "Copy API reference from 'fabric' to 'docs'"
run: |
cp docs/api.md project_documentation/docs/reference/api.md
cp docs/profiles.md project_documentation/docs/reference/profiles.md
cp docs/supported-devices.md project_documentation/docs/install-upgrade/supported-devices.md.gen

- name: "Generate token for the 'docs' repository"
uses: "actions/create-github-app-token@v2"
id: "app-token"
with:
app-id: "${{ secrets.DOCS_APP_ID }}"
private-key: "${{ secrets.DOCS_PRIVATE_KEY }}"
repositories: |
docs

- name: "Create Pull Request"
uses: "peter-evans/create-pull-request@v5"
with:
token: "${{ steps.app-token.outputs.token }}"
path: "project_documentation"
commit-message: |
Update docs from ${{ github.repository }}@${{ github.ref_name }}.

This is an automated commit created by GitHub Actions workflow,
in the "${{ github.repository }}" repository.
signoff: true
title: "Update docs from ${{ github.repository }}@${{ github.ref_name }}"
body: |
This is an automated Pull Request created by GitHub Actions workflow,
in the "${{ github.repository }}" repository.

It should be merged only after ${{ github.repository }} in the fabricator
repository master branch updated to the ${{ github.ref_name }}.