Refactor extensions docs to enable versioning (#12355) #217
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: Publish Docusaurus | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: yarn | |
- name: Install dependencies | |
run: cd docusaurus/ && yarn install:ci | |
- name: Build website | |
run: cd docusaurus/ && yarn build | |
- name: Add CNAME | |
run: | | |
echo "extensions.rancher.io" > ./docusaurus/build/CNAME | |
- name: Upload artifact | |
if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }} | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docusaurus/build | |
retention-days: 10 | |
compression-level: 9 | |
# Seperate the deploy job to isolate write permissions | |
deploy: | |
name: Publish | |
if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }} | |
runs-on: ubuntu-latest | |
needs: build | |
# This is required to avoid https://github.com/actions/deploy-pages/issues/271 | |
environment: | |
name: github-pages | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 |