forked from OpenLineage/OpenLineage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pawel Leszczynski <[email protected]>
- Loading branch information
1 parent
c0f6c01
commit 2a9be71
Showing
9 changed files
with
196 additions
and
170 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build & Deploy javadoc | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
branches: | ||
# testing only, not allowed to run on OpenLineage/OpenLineage repo | ||
- test-docs-deploy | ||
|
||
jobs: | ||
env: | ||
# hack from https://github.com/orgs/community/discussions/25725#discussioncomment-3248924 | ||
# to allow setting variable based on conditions | ||
branch: fromJSON('["main", "test-docs-deploy"]')[(github.head_ref || github.ref_name) == 'test-docs-deploy'] | ||
generate_javadoc: | ||
if: | | ||
(github.ref == 'refs/heads/test-docs-deploy' && github.repository != 'OpenLineage/OpenLineage' ) || | ||
(github.ref != 'refs/heads/test-docs-deploy' && github.repository == 'OpenLineage/OpenLineage') | ||
name: "Generate Java docs" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '11' | ||
- uses: actions/checkout@v4 | ||
- name: Generate new java doc | ||
run: | | ||
cd client/java | ||
./gradlew --console=plain javadoc | ||
- name: Get git branch | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git fetch | ||
git checkout ${{ env.branch }} | ||
- name: Clear existing javadoc | ||
run: rm -rf website/static/apidocs/javadoc | ||
- name: Copy docs to website directory | ||
run: cp -r client/java/build/docs/javadoc website/static/apidocs | ||
- name: Commit javadoc | ||
run: | | ||
git add website/static/apidocs/javadoc/ | ||
git commit -m "[generated] reloading javadoc" | ||
git push | ||
netlify-deploy-changes: | ||
env: | ||
# hack from https://github.com/orgs/community/discussions/25725#discussioncomment-3248924 | ||
# to allow setting variable based on conditions | ||
branch: fromJSON('["main", "test-docs-deploy"]')[(github.head_ref || github.ref_name) == 'test-docs-deploy'] | ||
uses: ./.github/workflows/netlify-deploy.yml | ||
needs: generate_javadoc | ||
inputs: | ||
branch: ${{ env.branch }} # shall be `main` or `test-docs-deploy` for testing | ||
secrets: | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
NETLIFY_TOKEN_SECRET: ${{ secrets.NETLIFY_TOKEN_SECRET }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 'Reusable netlify deploy workflow' | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
secrets: | ||
NETLIFY_SITE_ID: | ||
required: true | ||
NETLIFY_TOKEN_SECRET: | ||
required: true | ||
|
||
jobs: | ||
netlify-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Repository Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: "npm" | ||
cache-dependency-path: website/package-lock.json | ||
- name: Install Netlify | ||
run: | | ||
cd website | ||
npm install [email protected] -g | ||
- name: Install Dependencies | ||
run: | | ||
cd website | ||
yarn | ||
- name: Build project | ||
run: | | ||
cd website | ||
yarn build | ||
- name: Deploy to Netlify | ||
id: netlify_deploy | ||
run: | | ||
cd website/build | ||
netlify deploy \ | ||
--cwd . \ | ||
--dir . \ | ||
--site ${{ secrets.NETLIFY_SITE_ID }} \ | ||
--auth ${{ secrets.NETLIFY_TOKEN_SECRET }} \ | ||
--prod \ | ||
--open |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Build & Deploy spec to Netlify | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
# testing only, not allowed to run on OpenLineage/OpenLineage repo | ||
- test-docs-deploy | ||
|
||
jobs: | ||
generate_spec: | ||
env: | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
if: | | ||
(github.ref == 'refs/heads/test-docs-deploy' && github.repository != 'OpenLineage/OpenLineage' ) || | ||
(github.event.pull_request.merged == true && github.repository == 'OpenLineage/OpenLineage') | ||
name: 'Commit Spec definition' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Check changes | ||
id: check-changes | ||
run: | | ||
if git diff --name-only --exit-code HEAD^ HEAD -- 'spec/*.json' 'spec/OpenLineage.yml' >> /dev/null; then | ||
echo "no changes in spec detected, skipping publishing spec" | ||
exit 0 | ||
fi | ||
exit -1 | ||
continue-on-error: true | ||
- name: Check & Commit spec changes | ||
if: steps.check-changes.outcome == 'success' | ||
run: | | ||
# Copy changed spec JSON files to target location | ||
git diff --name-only HEAD^ HEAD -- 'spec/*.json' | while read LINE; do | ||
# ignore registry files | ||
if [[ $LINE =~ "registry.json" ]]; then | ||
continue | ||
fi | ||
# extract target file name from $id field in spec files | ||
URL=$(cat $LINE | jq -r '.["$id"]') | ||
# extract target location in website repo | ||
LOC="website/static/${URL#*//*/}" | ||
LOC_DIR="${LOC%/*}" | ||
# create dir if necessary, and copy files | ||
echo "change detected in $LINE" | ||
mkdir -p $LOC_DIR | ||
cp $LINE $LOC | ||
done | ||
- name: Commit changes | ||
if: steps.check-changes.outcome == 'success' | ||
run: | | ||
# verify if there are any changes | ||
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git fetch | ||
git checkout ${{ env.branch }} | ||
git add website/static/spec/* | ||
git commit -m "[generated] adding spec changes" | ||
git push | ||
else | ||
echo "nothing to commit" | ||
fi | ||
# TODO: openapi build, question should be committed ? | ||
# step similar to this: https://github.com/OpenLineage/docs/blob/main/scripts/build-docs.sh | ||
|
||
netlify-deploy-changes: | ||
env: | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
uses: ./.github/workflows/netlify-deploy.yml | ||
needs: generate_spec | ||
inputs: | ||
branch: ${{ env.branch }} # shall be `main` or `test-docs-deploy` for testing | ||
secrets: | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
NETLIFY_TOKEN_SECRET: ${{ secrets.NETLIFY_TOKEN_SECRET }} |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.