mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-02-18 02:51:58 -05:00
## Description --- This PR moves the deployement of the PR Previews to the newly created versioned-gh-pages branch which hosts the versioned doc site. ## PR Checklist --- > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [x] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) - [x] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here>
60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
# Copyright 2025 Google LLC
|
|
#
|
|
# 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: "docs"
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
# This Workflow depends on 'github.event.number',
|
|
# not compatible with branch or manual triggers.
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
|
|
jobs:
|
|
clean:
|
|
if: ${{ !github.event.pull_request.head.repo.fork }}
|
|
runs-on: ubuntu-24.04
|
|
concurrency:
|
|
# Shared concurrency group wih preview staging.
|
|
group: "preview-${{ github.event.number }}"
|
|
cancel-in-progress: true
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
with:
|
|
ref: versioned-gh-pages
|
|
|
|
- name: Remove Preview
|
|
run: |
|
|
rm -Rf ./previews/PR-${{ github.event.number }}
|
|
git config user.name 'github-actions[bot]'
|
|
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
|
git add -u previews/PR-${{ github.event.number }}
|
|
git commit --message "cleanup: previews/PR-${{ github.event.number }}"
|
|
git push
|
|
|
|
- name: Comment
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
|
|
with:
|
|
script: |
|
|
github.rest.issues.createComment({
|
|
issue_number: context.payload.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: "🧨 Preview deployments removed."
|
|
})
|