MultiRegistry Beta API #1090
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: Spec PR | |
# This workflow uploads a copy of the spec with the respective changes in the PR | |
# to the team Space. | |
# | |
# The name of the uploaded file will be prefixed with the PR number. | |
# e.g. `spec-ci/previews/123-spec.yaml | |
on: [pull_request] | |
jobs: | |
lint: | |
name: Validate spec | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run linter | |
run: make lint | |
bundle-spec: | |
name: Bundle Spec | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Bundle | |
run: make bundle | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: openapi-bundled | |
path: tests/openapi-bundled.yaml | |
generate-preview: | |
# As this job needs access to secrets, skip it if the PR comes from a fork. | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
name: Generate Preview | |
runs-on: ubuntu-latest | |
needs: bundle-spec | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Bundle | |
run: make bundle | |
- name: Upload PR spec | |
run: >- | |
aws s3 cp tests/openapi-bundled.yaml | |
${{ env.SPACES_PATH }}/previews/${{ github.event.number }}-spec.yaml | |
--endpoint=${{ env.SPACES_ENDPOINT }} | |
--acl public-read | |
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 | |
- uses: Sibz/github-status-action@v1 | |
with: | |
authToken: ${{secrets.GITHUB_TOKEN}} | |
context: Spec Preview URL | |
description: Ready | |
state: success | |
sha: ${{ github.event.pull_request.head.sha }} | |
target_url: https://api-engineering.nyc3.digitaloceanspaces.com/spec-ci/redoc-index.html?pr=${{ github.event.number }} |