Merge pull request #259 from commercetools/dynatrace-integration #34
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: Docs | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+*' | |
jobs: | |
update_ref: | |
runs-on: ubuntu-latest | |
if: startsWith( github.ref, 'refs/tags/') | |
steps: | |
# Get GitHub token via the CT SDKs App | |
- name: Generate GitHub token (via CT SDKs App) | |
id: generate_github_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.CT_SDKS_APP_ID }} | |
private-key: ${{ secrets.CT_SDKS_APP_PEM }} | |
- name: Get App user | |
id: get_app_user | |
env: | |
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} | |
run: | | |
export GH_APP_USER=`gh api /users/ct-sdks%5Bbot%5D | jq .id` | |
echo "email=${GH_APP_USER}+ct-sdks[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
token: ${{ steps.generate_github_token.outputs.token }} | |
- name: "Switch SDK to after release branch" | |
run: | | |
git fetch --depth=1 origin after-release || true | |
git checkout -B after-release origin/after-release || true | |
git checkout -B after-release | |
git log -1 | |
- name: "remove API reference commit SHA" | |
run: rm -rf reference.txt | |
continue-on-error: true | |
- uses: stefanzweifel/git-auto-commit-action@e8f94e4dd298db5a6a2aa2d42fe0bcef6f2c9660 | |
with: | |
branch: after-release | |
commit_message: "TASK: Updating version in README" | |
commit_author: ct-sdks[bot] <${{ steps.get_app_user.outputs.email }}> | |
commit_user_name: ct-sdks[bot] | |
commit_user_email: ${{ steps.get_app_user.outputs.email }} | |
unittests: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
# Get GitHub token via the CT SDKs App | |
- name: Generate GitHub token (via CT SDKs App) | |
id: generate_github_token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.CT_SDKS_APP_ID }} | |
private-key: ${{ secrets.CT_SDKS_APP_PEM }} | |
- name: Get App user | |
id: get_app_user | |
env: | |
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }} | |
run: | | |
export GH_APP_USER=`gh api /users/ct-sdks%5Bbot%5D | jq .id` | |
echo "email=${GH_APP_USER}+ct-sdks[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: sdk | |
token: ${{ steps.generate_github_token.outputs.token }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: doc | |
ref: gh-pages | |
token: ${{ steps.generate_github_token.outputs.token }} | |
- name: Install Doxygen | |
run: sudo apt-get install doxygen -y | |
shell: bash | |
- name: Generate Doxygen Documentation | |
run: doxygen doxygen_config | |
shell: bash | |
working-directory: sdk | |
env: | |
PROJECT_NUMBER: ${{ github.ref_name }} | |
- run: rsync -r --delete ./sdk/docs ./doc | |
- uses: stefanzweifel/git-auto-commit-action@e8f94e4dd298db5a6a2aa2d42fe0bcef6f2c9660 | |
with: | |
repository: doc | |
commit_message: "Update docs" | |
commit_author: ct-sdks[bot] <${{ steps.get_app_user.outputs.email }}> | |
commit_user_name: ct-sdks[bot] | |
commit_user_email: ${{ steps.get_app_user.outputs.email }} |