Skip to content

Deploy older version #13666

Deploy older version

Deploy older version #13666

name: pr-deploy-and-comment
on:
workflow_dispatch:
pull_request:
jobs:
pr-deploy-and-comment:
runs-on: [self-hosted, x64, private]
container:
image: ghcr.io/viamrobotics/canon:amd64
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true # fetch hugo themes
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'v0.100.0'
extended: true
- name: Temp config
run: |
echo url_latest_version = \"https://docs-test.viam.dev/${{ github.sha }}/public\" > config_pr.toml
echo baseURL = \"https://docs-test.viam.dev/${{ github.sha }}/public\" >> config_pr.toml
- name: Build
run: make build-pr
- name: Authenticate on GCS
uses: google-github-actions/auth@v0
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: Copy generated site to GCS bucket
uses: 'google-github-actions/upload-cloud-storage@v0'
with:
path: 'public'
destination: 'docs-test.viam.dev/${{ github.sha }}'
- name: Comment on PR with link to rendered site
uses: marocchino/[email protected]
with:
recreate: true
message: 'You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/${{ github.sha }}/public'
GITHUB_TOKEN: ${{ secrets.PR_TOKEN }}