-
Notifications
You must be signed in to change notification settings - Fork 6.1k
docs: update docs preview #4968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,89 +17,24 @@ permissions: | |
security-events: none | ||
statuses: none | ||
|
||
# Cancel in-progress runs for pull requests when developers push | ||
# additional changes, and serialize builds in branches. | ||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
||
jobs: | ||
preview: | ||
name: Docs preview | ||
runs-on: ubuntu-20.04 | ||
environment: CI | ||
# Only run if PR comes from base repo | ||
# Reason: forks cannot access secrets and this will always fail | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: Checkout m | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: coder/m | ||
ref: refs/heads/master | ||
ssh-key: ${{ secrets.READONLY_M_DEPLOY_KEY }} | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Cache Node Modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: "/node_modules" | ||
key: node-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Create Deployment | ||
id: deployment | ||
run: ./ci/scripts/github_deployment.sh create | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
DEPLOY_ENVIRONMENT: codercom-preview-docs | ||
|
||
- name: Deploy Preview to Vercel | ||
id: preview | ||
run: ./ci/scripts/deploy_vercel.sh | ||
env: | ||
VERCEL_ORG_ID: team_tGkWfhEGGelkkqUUm9nXq17r | ||
VERCEL_PROJECT_ID: QmZRucMRh3GFk1817ZgXjRVuw5fhTspHPHKct3JNQDEPGd | ||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
CODE_SERVER_DOCS_MAIN_BRANCH: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install node_modules | ||
run: yarn install | ||
|
||
- name: Check docs | ||
run: yarn ts-node ./product/coder.com/site/scripts/checkDocs.ts | ||
env: | ||
BASE_URL: ${{ steps.preview.outputs.url }} | ||
|
||
- name: Update Deployment | ||
# If we don't specify always, it won't run this check if failed. | ||
# This means the deployment would be stuck pending. | ||
if: always() | ||
run: ./ci/scripts/github_deployment.sh update | ||
env: | ||
GITHUB_DEPLOYMENT: ${{ steps.deployment.outputs.id }} | ||
GITHUB_TOKEN: ${{ github.token }} | ||
DEPLOY_STATUS: ${{ steps.preview.outcome }} | ||
DEPLOY_URL: ${{ steps.preview.outputs.url }} | ||
- name: Set outputs | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
|
||
- name: Comment Credentials | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: always() | ||
with: | ||
header: codercom-preview-docs | ||
message: | | ||
✨ Coder.com for PR #${{ github.event.number }} deployed! It will be updated on every commit. | ||
|
||
* _Host_: ${{ steps.preview.outputs.url }}/docs/code-server | ||
* _Last deploy status_: ${{ steps.preview.outcome }} | ||
✨ code-server docs for PR #${{ github.event.number }} is ready! It will be updated on every commit. | ||
* _Host_: https://coder.com/docs/code-server/${{ steps.vars.outputs.sha_short }} | ||
* _Last deploy status_: success | ||
* _Commit_: ${{ github.event.pull_request.head.sha }} | ||
* _Workflow status_: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.