Skip to content

Make docs great again #2620

Make docs great again

Make docs great again #2620

Workflow file for this run

name: Docs
on:
pull_request:
branches:
- 'main'
paths:
- 'website/**'
push:
branches:
- 'main'
paths:
- 'website/**'
workflow_dispatch:
permissions:
contents: read # for actions/checkout to fetch code
jobs:
# staging-release:
# permissions:
# statuses: write
# if: ${{ github.event_name != 'push' && github.repository_owner == 'weaveworks' && !github.event.pull_request.head.repo.fork }}
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: website
# steps:
# - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
# - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
# with:
# node-version: "16.x"
# - name: Build docs
# env:
## GA_KEY: "dummy"
## ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
# NODE_OPTIONS: "--max-old-space-size=4096"
# GITHUB_HEAD_REF: ${{ github.head_ref }}
# run: |
# yarn install --frozen-lockfile
# yarn clear
# export DOC_BASE_URL="/$GITHUB_HEAD_REF/"
# export DOC_URL=https://staging.docs.gitops.weaveworks.org
# export STAGING_BUILD=true
# yarn build
# touch build/.nojekyll
#
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v3
# with:
# name: github-pages
# path: website/build
# retention-days: 365
build:
# Specify runner + build & upload the static files as an artifact
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: "16.x"
- name: Build docs
env:
# GA_KEY: "dummy"
# ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
NODE_OPTIONS: "--max-old-space-size=4096"
GITHUB_HEAD_REF: ${{ github.head_ref }}
run: |
yarn install --frozen-lockfile
yarn clear
export DOC_BASE_URL="/$GITHUB_HEAD_REF/"
export DOC_URL=https://staging.docs.gitops.weaveworks.org
export STAGING_BUILD=true
yarn build
touch build/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: website/build
retention-days: 365
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
defaults:
run:
working-directory: website
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
prod-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: "16.x"
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Build docs
env:
# GA_KEY: ${{ secrets.GA_KEY }}
# ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
NODE_OPTIONS: "--max-old-space-size=4096"
run: |
yarn install --frozen-lockfile
yarn clear
yarn build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: website/build
retention-days: 365