Version documentation #1
Workflow file for this run
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: Version documentation | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
permissions: | |
id-token: write | |
jobs: | |
site-deploy: | |
name: Build and Publish To openlineage-site repo | |
runs-on: ubuntu-latest | |
environment: openlineage-site-push | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: 'source' | |
fetch-depth: 0 | |
fetch-tags: true | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'Openlineage/openlineage-site' | |
path: 'target' | |
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "npm" | |
cache-dependency-path: source/website/package-lock.json | |
- name: Install dependencies | |
run: | | |
cd target | |
yarn install --frozen-lockfile | |
- name: Generate new version | |
run: | | |
cd source | |
echo latest version is $GITHUB_REF_NAME | |
cd ../target | |
if [ -d "versioned_docs/version-$GITHUB_REF_NAME" ] | |
then | |
echo "Version already exists. skipping" | |
else | |
echo "Generating version $GITHUB_REF_NAME" | |
yarn run docusaurus docs:version $GITHUB_REF_NAME | |
fi | |
- name: Push target repo | |
run: | | |
cd target | |
git config user.name "GitHub Action Website Snapshot" | |
git config user.email "<>" | |
git add . | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "Generating new version $GITHUB_REF_NAME" | |
git push | |
fi |