Skip to content

Commit 2313cef

Browse files
Update preview link (coder#883)
1 parent 544232d commit 2313cef

File tree

1 file changed

+7
-66
lines changed

1 file changed

+7
-66
lines changed

.github/workflows/preview.yaml

+7-66
Original file line numberDiff line numberDiff line change
@@ -18,84 +18,25 @@ permissions:
1818
security-events: none
1919
statuses: none
2020

21-
# Cancel in-progress runs for pull requests when developers push
22-
# additional changes, and serialize builds in branches.
23-
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
24-
concurrency:
25-
group: ${{ github.workflow }}-${{ github.ref }}
26-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
27-
2821
jobs:
2922
preview:
3023
name: Preview
31-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-latest
3225
steps:
33-
- name: Checkout m
34-
uses: actions/checkout@v3
35-
with:
36-
repository: cdr/m
37-
ref: refs/heads/master
38-
ssh-key: ${{ secrets.READONLY_M_DEPLOY_KEY }}
39-
submodules: true
40-
fetch-depth: 0
41-
42-
- name: Install Node.js
43-
uses: actions/setup-node@v3
44-
with:
45-
node-version: 14
46-
47-
- name: Cache Node Modules
48-
uses: actions/cache@v2
49-
with:
50-
path: "/node_modules"
51-
key: node-${{ hashFiles('yarn.lock') }}
52-
53-
- name: Create Deployment
54-
id: deployment
55-
run: ./ci/scripts/github_deployment.sh create
56-
env:
57-
GITHUB_TOKEN: ${{ github.token }}
58-
DEPLOY_ENVIRONMENT: codercom-preview-docs
59-
60-
- name: Deploy Preview to Vercel
61-
id: preview
62-
run: ./ci/scripts/deploy_vercel.sh
63-
env:
64-
VERCEL_ORG_ID: team_tGkWfhEGGelkkqUUm9nXq17r
65-
VERCEL_PROJECT_ID: QmZRucMRh3GFk1817ZgXjRVuw5fhTspHPHKct3JNQDEPGd
66-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
67-
CODER_DOCS_MAIN_BRANCH: ${{ github.event.pull_request.head.sha }}
68-
69-
# This ensures the docs site is built properly
70-
# as it will sometimes throw a 404 or 500
71-
# error if Markdown/parsing errors are present
72-
- name: Install node_modules
73-
run: yarn install
74-
- name: Check docs
75-
run: yarn ts-node ./product/coder.com/site/scripts/checkDocs.ts
76-
env:
77-
BASE_URL: ${{ steps.preview.outputs.url }}
26+
- uses: actions/checkout@v3
7827

79-
- name: Update Deployment
80-
# If we don't specify always, it won't run this check if failed.
81-
# This means the deployment would be stuck pending.
82-
if: always()
83-
run: ./ci/scripts/github_deployment.sh update
84-
env:
85-
GITHUB_DEPLOYMENT: ${{ steps.deployment.outputs.id }}
86-
GITHUB_TOKEN: ${{ github.token }}
87-
DEPLOY_STATUS: ${{ steps.preview.outcome }}
88-
DEPLOY_URL: ${{ steps.preview.outputs.url }}
28+
- name: Set outputs
29+
id: vars
30+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
8931

9032
- name: Comment Credentials
9133
uses: marocchino/sticky-pull-request-comment@v2
92-
if: always()
9334
with:
9435
header: codercom-preview-docs
9536
message: |
9637
✨ Coder.com for PR #${{ github.event.number }} deployed! It will be updated on every commit.
9738
98-
* _Host_: ${{ steps.preview.outputs.url }}/docs
99-
* _Last deploy status_: ${{ steps.preview.outcome }}
39+
* _Host_: https://coder.com/docs/coder/${{ steps.vars.outputs.sha_short }}
40+
* _Last deploy status_: success
10041
* _Commit_: ${{ github.event.pull_request.head.sha }}
10142
* _Workflow status_: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)