Pin the Redoc version used in PR previews. #3
Workflow file for this run
This file contains 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: ReDoc Index PR | |
# This workflow uploads a copy of the `docs-preview/redoc-index.html` to the | |
# team spaces directory when a change is detected on the file. | |
# For PRs, the uploaded file name will be suffixed with the PR number. | |
# e.g. `docs-preview/redoc-index-pr-123.html` | |
on: | |
pull_request_target: | |
paths: | |
- 'docs-preview/redoc-index.html' | |
jobs: | |
upload-index-preview: | |
name: Upload Index Preview | |
runs-on: ubuntu-latest | |
env: | |
REDOC_INDEX_FILENAME: redoc-index-pr-${{ github.event.number }}.html | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Upload index to spaces | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_SECRET }} | |
AWS_DEFAULT_OUTPUT: json | |
SPACES_PATH: ${{ secrets.SPACES_PATH }} | |
SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }} | |
AWS_EC2_METADATA_DISABLED: true | |
run: >- | |
aws s3 cp docs-preview/redoc-index.html | |
${{ env.SPACES_PATH }}/${{ env.REDOC_INDEX_FILENAME }} | |
--endpoint=${{ env.SPACES_ENDPOINT }} | |
--acl public-read | |
- uses: Sibz/github-status-action@v1 | |
with: | |
authToken: ${{secrets.GITHUB_TOKEN}} | |
context: ReDoc Index Preview URL | |
description: Ready | |
state: success | |
sha: ${{ github.event.pull_request.head.sha }} | |
target_url: https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/${{ env.REDOC_INDEX_FILENAME }} |