Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github action for sending updated docs to otel.io repo #252

Merged
merged 1 commit into from
May 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/docs_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update OpenTelemetry Website Docs
on:
# triggers only on a manual dispatch
workflow_dispatch:
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2.3.4
- name: make-pr
env:
API_TOKEN_GITHUB: ${{secrets.DOC_UPDATE_TOKEN}}
# Destination repo should always be 'open-telemetry/opentelemetry.io'
DESTINATION_REPO: open-telemetry/opentelemetry.io
# Destination path should be the absolute path to your language's friendly name in the docs tree (i.e, 'content/en/docs/java')
DESTINATION_PATH: content/en/docs/erlang
# Source path should be 'website_docs', all files and folders are copied from here to dest
SOURCE_PATH: website_docs
run: |
TARGET_DIR=$(mktemp -d)
export GITHUB_TOKEN=$API_TOKEN_GITHUB
git config --global user.name austinlparker
git config --global user.email austin@lightstep.com
git clone "https://$API_TOKEN_GITHUB@github.com/$DESTINATION_REPO.git" "$TARGET_DIR"
rsync -av --delete "$SOURCE_PATH/" "$TARGET_DIR/$DESTINATION_PATH/"
cd "$TARGET_DIR"
git checkout -b docs-$GITHUB_REPOSITORY-$GITHUB_SHA
git add .
git commit -m "Docs update from $GITHUB_REPOSITORY"
git push -u origin HEAD:docs-$GITHUB_REPOSITORY-$GITHUB_SHA
gh pr create -t "Docs Update from $GITHUB_REPOSITORY" -b "This is an automated pull request." -B main -H docs-$GITHUB_REPOSITORY-$GITHUB_SHA
echo "done"