Update main.yml #31
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 | |
mkdir -p ../docs-beta | |
mv dist/* ../docs-beta/ # Move build output to the new folder | |
- 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 # Set working directory to the new folder | |
production: true |