@@ -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-
2720jobs :
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- 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 }}
0 commit comments