Skip to content

Commit

Permalink
[DPE-2319] Enabling Discourse Gatekeeper one-way sync (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
deusebio authored Sep 26, 2023
1 parent dfda5ad commit d919362
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ jobs:
- name: Run tests
run: tox run -e security

sync-docs:
uses: ./.github/workflows/sync_docs.yaml
secrets: inherit
permissions:
contents: write # Needed to update tags
pull-requests: write # Need to create PR

build:
name: Build charms
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ jobs:
needs:
- lib-check
uses: ./.github/workflows/ci.yaml
secrets: inherit
permissions:
contents: write # Needed to login to Discourse
pull-requests: write # Need to create PR
actions: write

build:
name: Build charm
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/sync_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Sync docs from Discourse

on:
workflow_dispatch:
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
workflow_call:

jobs:
sync-docs:
name: Open PR with docs changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Open PR with docs changes
uses: deusebio/discourse-gatekeeper@main
id: docs-pr
with:
discourse_host: discourse.charmhub.io
discourse_api_username: ${{ secrets.DISCOURSE_API_USERNAME }}
discourse_api_key: ${{ secrets.DISCOURSE_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: "true"

- name: Show migrate output
run: echo '${{ steps.docs-pr.outputs.migrate }}'
- name: Show reconcile output
run: echo '${{ steps.docs-pr.outputs.reconcile }}'

0 comments on commit d919362

Please sign in to comment.