Skip to content

add deploy preview action #2

add deploy preview action

add deploy preview action #2

name: Deploy pr preview
on:
pull_request:
types:
- opened
- synchronize
- closed
jobs:
deploy-pr-preview:
if: github.repository == 'grafana/writers-toolkit'
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
common_secrets: |
PUBLISH_TECHNICAL_DOCUMENTATION_APP_ID=docs-team/publish-technical-documentation:app-id
PUBLISH_TECHNICAL_DOCUMENTATION_PRIVATE_KEY=docs-team/publish-technical-documentation:key
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ env.PUBLISH_TECHNICAL_DOCUMENTATION_APP_ID }}
owner: grafana
private-key: ${{ env.PUBLISH_TECHNICAL_DOCUMENTATION_PRIVATE_KEY }}
repositories: website
- uses: grafana/website/.github/workflows/deploy-preview.yml@robbymilo/gh-deploy-previews
with:
sha: ${{ github.event.pull_request.head.sha }}
branch: ${{ github.ref_name }}
event_number: ${{ github.event.number }}
repo: website