Skip to content
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

chore: Add deploy workflow for docs site #15894

Merged
merged 3 commits into from May 20, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/docs-deploy.yml
@@ -0,0 +1,28 @@
name: 'Docs Deploy'

on:
release:
types: ['published']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't figure out from the docs whether this includes pre-releases, which we probably wouldn't want. Either way, that doesn't seem important at this moment.


jobs:
deploy:
name: 'Deploy'
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: cd docs
- name: Install Packages
run: npm install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that this won't work as expected, because every step starts from the initial directory, so cd docs in one step doesn't mean that npm install will be run in docs/ in the following step.

We could use | or working-directory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah interesting. I’ll fix that.

- name: Build Site
run: npm run build
- name: Deploy to Netlify
run: npx netlify deploy --dir=_site --message='Docs deploy ${{ github.event.release.tag_name }}'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DEPLOY_TO_PROD: true
1 change: 1 addition & 0 deletions docs/package.json
Expand Up @@ -30,6 +30,7 @@
"imagemin-cli": "^7.0.0",
"markdown-it": "^12.2.0",
"markdown-it-anchor": "^8.1.2",
"netlify-cli": "^10.3.1",
"node-sass": "^6.0.1",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
Expand Down