Merge pull request #1068 from DuendeSoftware/maartenba-patch-1 #867
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: docs/ci-cd | |
| on: | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened, closed, labeled] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-deploy: | |
| name: Build and Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e | |
| with: | |
| app-id: ${{ vars.DUENDE_GITHUB_BOT_APP_ID }} | |
| private-key: ${{ secrets.DUENDE_GITHUB_BOT_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| repositories: ${{ secrets.OPS_REPOSITORY_NAME }} | |
| - name: Trigger Ops Workflow | |
| uses: actions/github-script@v8 | |
| with: | |
| github-token: ${{ steps.generate_token.outputs.token }} | |
| script: | | |
| await github.rest.repos.createDispatchEvent({ | |
| owner: '${{ github.repository_owner }}', | |
| repo: '${{ secrets.OPS_REPOSITORY_NAME }}', | |
| event_type: 'deploy-docs', | |
| client_payload: { | |
| "source_repo": "${{ github.repository }}", | |
| "ref": "${{ github.ref }}", | |
| "sha": "${{ github.sha }}", | |
| "pr_number": "${{ github.event.pull_request.number }}", | |
| "pr_label": "${{ github.event.label.name }}", | |
| "event": "${{ github.event.action}}" | |
| } | |
| }); |