@@ -18,84 +18,25 @@ permissions:
18
18
security-events : none
19
19
statuses : none
20
20
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
-
28
21
jobs :
29
22
preview :
30
23
name : Preview
31
- runs-on : ubuntu-20.04
24
+ runs-on : ubuntu-latest
32
25
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
78
27
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)"
89
31
90
32
- name : Comment Credentials
91
33
uses : marocchino/sticky-pull-request-comment@v2
92
- if : always()
93
34
with :
94
35
header : codercom-preview-docs
95
36
message : |
96
37
✨ Coder.com for PR #${{ github.event.number }} deployed! It will be updated on every commit.
97
38
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
100
41
* _Commit_: ${{ github.event.pull_request.head.sha }}
101
42
* _Workflow status_: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
0 commit comments