|
| 1 | +# |
| 2 | +# Copyright (C) 2024 Red Hat, Inc. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +# SPDX-License-Identifier: Apache-2.0 |
| 17 | + |
| 18 | +name: Publish Website |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_dispatch: |
| 22 | + push: |
| 23 | + branches: |
| 24 | + - main |
| 25 | + |
| 26 | +env: |
| 27 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 28 | + |
| 29 | +jobs: |
| 30 | + deploy: |
| 31 | + name: Build and deploy website |
| 32 | + runs-on: ubuntu-24.04 |
| 33 | + timeout-minutes: 60 |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + - uses: pnpm/action-setup@v4 |
| 37 | + name: Install pnpm |
| 38 | + with: |
| 39 | + run_install: false |
| 40 | + |
| 41 | + - uses: actions/setup-node@v4 |
| 42 | + with: |
| 43 | + node-version: 20 |
| 44 | + cache: 'pnpm' |
| 45 | + |
| 46 | + - name: Execute pnpm |
| 47 | + run: pnpm install |
| 48 | + |
| 49 | + - name: Run Build |
| 50 | + timeout-minutes: 20 |
| 51 | + run: pnpm website:build |
| 52 | + |
| 53 | + - name: Deploy to GitHub Pages |
| 54 | + uses: peaceiris/actions-gh-pages@v4 |
| 55 | + with: |
| 56 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + # Build output to publish to the `gh-pages` branch: |
| 58 | + publish_dir: ./dist |
| 59 | + # The following lines assign commit authorship to the official |
| 60 | + # GH-Actions bot for deploys to `gh-pages` branch: |
| 61 | + # https://github.com/actions/checkout/issues/13#issuecomment-724415212 |
| 62 | + # The GH actions bot is used by default if you didn't specify the two fields. |
| 63 | + # You can swap them out with your own user credentials. |
| 64 | + user_name: github-actions[bot] |
| 65 | + user_email: 41898282+github-actions[bot]@users.noreply.github.com |
0 commit comments