RSDK-3550-cartographer-full-mod2 (#1582) #6
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: docs-publish | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
if: github.repository_owner == 'viamrobotics' | |
runs-on: [self-hosted, x64, private] | |
container: | |
image: ghcr.io/viamrobotics/canon:amd64 | |
steps: | |
- name: Checkout Push/Workflow Dispatch | |
uses: actions/checkout@v3 | |
with: | |
submodules: true # fetch hugo themes | |
fetch-depth: 0 | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v2 | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: 'latest' | |
extended: true | |
- name: Build | |
run: make build-prod | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./public | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
generate-index: | |
needs: build | |
if: github.repository_owner == 'viamrobotics' | |
runs-on: [self-hosted, x64] | |
container: | |
image: ghcr.io/viamrobotics/canon:amd64 | |
steps: | |
- name: Checkout Push/Workflow Dispatch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Wait before index | |
run: sleep 300s | |
- name: Write env | |
run: | | |
echo TYPESENSE_API_KEY=${{ secrets.TYPESENSE_API_KEY }} > typesense.env | |
echo TYPESENSE_HOST=cgnvrk0xwyj9576lp-1.a1.typesense.net >> typesense.env | |
echo TYPESENSE_PORT=443 >> typesense.env | |
echo TYPESENSE_PROTOCOL=https >> typesense.env | |
- name: Index | |
run: docker run --env-file=typesense.env -e "CONFIG=$(cat docsearch.json)" typesense/docsearch-scraper |