asymingt builds and deploys github pages #13
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
| # Copyright 2025 Open Source Robotics Foundation, Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: build-and-deploy-rcr-ui | |
| run-name: ${{ github.actor }} builds and deploys github pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| repository_dispatch: | |
| types: [on-rcr-trigger] | |
| permissions: | |
| contents: write | |
| jobs: | |
| checkout-setup-build-test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository and submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Switch to latest gh-pages branch of the RCR | |
| run: | | |
| git submodule foreach git checkout origin/gh-pages | |
| - name: Install platform tooling | |
| timeout-minutes: 10 | |
| run: | | |
| sudo apt-get -qq install npm direnv | |
| sudo npm install -g pnpm | |
| eval "$(direnv hook bash)" | |
| - name: Setup Bazel | |
| uses: bazel-contrib/[email protected] | |
| with: | |
| bazelisk-cache: false | |
| disk-cache: ${{ github.workflow }} | |
| repository-cache: false | |
| - name: Install buildifier and buildozer | |
| run: | | |
| direnv allow . | |
| eval "$(direnv export bash)" | |
| echo "PATH=$PATH" >> $GITHUB_ENV | |
| bazel run //bin:bazel_env | |
| - name: Install project dependencies | |
| run: pnpm install | |
| - name: Generate static web pages | |
| run: NEXT_PUBLIC_BASE_PATH=/rcr-ui pnpm run build | |
| - name: Deploy to github pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: out |