Update main.yml #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation Deployment | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
generate-and-deploy: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
cd docs-beta | |
npm install | |
- name: Generate documentation | |
env: | |
OPENAI_API_KEY: ${{ secrets.LANA_OPENAI_API_KEY }} | |
MODEL: ${{ secrets.LANA_MODEL }} | |
run: | | |
cd docs-beta | |
npm install -g yargs | |
npm install -g lanadoc-cli | |
lanadoc config --set LANA_OPENAI_API_KEY=$OPENAI_API_KEY | |
lanadoc config --set LANA_MODEL=$MODEL | |
lanadoc generate | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | |
- name: Build Vue.js application | |
run: | | |
cd docs-beta | |
npm run build | |
- name: Set Vercel root directory via API | |
run: | | |
curl -X PATCH "https://api.vercel.com/v9/projects/${{ secrets.VERCEL_PROJECT_ID }}" \ | |
-H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}" \ | |
-H "Content-Type: application/json" \ | |
-d '{ | |
"rootDirectory": null | |
}' | |
- name: Deploy to Vercel | |
uses: amondnet/vercel-action@v20 | |
with: | |
vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
vercel-username: ${{ secrets.VERCEL_USERNAME }} | |
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
working-directory: docs-beta | |
vercel-args: '--prod' # add this to promote to production url automatically | |
production: true |