Deploy docs to netlify #170
This file contains hidden or 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: Deploy docs to netlify | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
jobs: | |
deploy-netlify: | |
name: deploy-to-netlify | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Node.js 20.18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.18 | |
- name: Gather Meilisearch APi Key from Netlify config file | |
run: | | |
API_KEY=$(grep 'MEILISEARCH_API_KEY' netlify.toml | cut -d '=' -f2 | tr -d ' "') | |
echo "MEILISEARCH_API_KEY=$API_KEY" >> "$GITHUB_ENV" | |
- name: Build docs.gno.land | |
working-directory: ./docusaurus | |
run: | | |
yarn run download-docs | |
yarn install | |
yarn build | |
env: | |
MEILISEARCH_URL: "https://docs-search.gnoteam.com" | |
MEILISEARCH_INDEX_UID: "production" | |
- name: Deploy to netlify | |
run: | | |
npm install -g netlify-cli | |
netlify deploy --prod --debug | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |