Skip to content

Commit ed0a2a2

Browse files
authored
Merge branch 'main' into 4924-feat-publish-dev-builds-to-@coder/code-server-pr
2 parents 826a9b0 + 77296c7 commit ed0a2a2

File tree

2 files changed

+8
-73
lines changed

2 files changed

+8
-73
lines changed

.github/workflows/docs-preview.yaml

+7-72
Original file line numberDiff line numberDiff line change
@@ -17,89 +17,24 @@ permissions:
1717
security-events: none
1818
statuses: none
1919

20-
# Cancel in-progress runs for pull requests when developers push
21-
# additional changes, and serialize builds in branches.
22-
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
23-
concurrency:
24-
group: ${{ github.workflow }}-${{ github.ref }}
25-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
26-
2720
jobs:
2821
preview:
2922
name: Docs preview
3023
runs-on: ubuntu-20.04
31-
environment: CI
32-
# Only run if PR comes from base repo
33-
# Reason: forks cannot access secrets and this will always fail
34-
if: github.event.pull_request.head.repo.full_name == github.repository
3524
steps:
36-
- name: Cancel Previous Runs
37-
uses: styfle/[email protected]
38-
39-
- name: Checkout m
40-
uses: actions/checkout@v3
41-
with:
42-
repository: coder/m
43-
ref: refs/heads/master
44-
ssh-key: ${{ secrets.READONLY_M_DEPLOY_KEY }}
45-
submodules: true
46-
fetch-depth: 0
47-
48-
- name: Install Node.js
49-
uses: actions/setup-node@v3
50-
with:
51-
node-version: 14
52-
53-
- name: Cache Node Modules
54-
uses: actions/cache@v2
55-
with:
56-
path: "/node_modules"
57-
key: node-${{ hashFiles('yarn.lock') }}
58-
59-
- name: Create Deployment
60-
id: deployment
61-
run: ./ci/scripts/github_deployment.sh create
62-
env:
63-
GITHUB_TOKEN: ${{ github.token }}
64-
DEPLOY_ENVIRONMENT: codercom-preview-docs
65-
66-
- name: Deploy Preview to Vercel
67-
id: preview
68-
run: ./ci/scripts/deploy_vercel.sh
69-
env:
70-
VERCEL_ORG_ID: team_tGkWfhEGGelkkqUUm9nXq17r
71-
VERCEL_PROJECT_ID: QmZRucMRh3GFk1817ZgXjRVuw5fhTspHPHKct3JNQDEPGd
72-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
73-
CODE_SERVER_DOCS_MAIN_BRANCH: ${{ github.event.pull_request.head.sha }}
25+
- uses: actions/checkout@v3
7426

75-
- name: Install node_modules
76-
run: yarn install
77-
78-
- name: Check docs
79-
run: yarn ts-node ./product/coder.com/site/scripts/checkDocs.ts
80-
env:
81-
BASE_URL: ${{ steps.preview.outputs.url }}
82-
83-
- name: Update Deployment
84-
# If we don't specify always, it won't run this check if failed.
85-
# This means the deployment would be stuck pending.
86-
if: always()
87-
run: ./ci/scripts/github_deployment.sh update
88-
env:
89-
GITHUB_DEPLOYMENT: ${{ steps.deployment.outputs.id }}
90-
GITHUB_TOKEN: ${{ github.token }}
91-
DEPLOY_STATUS: ${{ steps.preview.outcome }}
92-
DEPLOY_URL: ${{ steps.preview.outputs.url }}
27+
- name: Set outputs
28+
id: vars
29+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
9330

9431
- name: Comment Credentials
9532
uses: marocchino/sticky-pull-request-comment@v2
96-
if: always()
9733
with:
9834
header: codercom-preview-docs
9935
message: |
100-
✨ Coder.com for PR #${{ github.event.number }} deployed! It will be updated on every commit.
101-
102-
* _Host_: ${{ steps.preview.outputs.url }}/docs/code-server
103-
* _Last deploy status_: ${{ steps.preview.outcome }}
36+
✨ code-server docs for PR #${{ github.event.number }} is ready! It will be updated on every commit.
37+
* _Host_: https://coder.com/docs/code-server/${{ steps.vars.outputs.sha_short }}
38+
* _Last deploy status_: success
10439
* _Commit_: ${{ github.event.pull_request.head.sha }}
10540
* _Workflow status_: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

docs/guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ There are several approaches to operating and exposing code-server securely:
5252
We highly recommend using [port forwarding via
5353
SSH](https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding) to access
5454
code-server. If you have an SSH server on your remote machine, this approach
55-
doesn't required additional setup.
55+
doesn't require any additional setup at all.
5656

5757
The downside to SSH forwarding, however, is that you can't access code-server
5858
when using machines without SSH clients (such as iPads). If this applies to you,

0 commit comments

Comments
 (0)