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 to automatically update docs version #2122

Merged
merged 7 commits into from Dec 14, 2019
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/update-docs-version.yml
@@ -0,0 +1,30 @@
name: Update docs version

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Update latest_version property in mkdocs.yml
run: |
sed -i "s/latest_version: .*/latest_version: ${GITHUB_REF##*/}/g" mkdocs.yml
bsideup marked this conversation as resolved.
Show resolved Hide resolved
- name: Commit changes
env:
COMMIT_MSG: |
Update documentation version to ${GITHUB_REF##*/}
bsideup marked this conversation as resolved.
Show resolved Hide resolved
skip-checks: true
run: |
git config user.email "nobody@testcontainers.org"
git config user.name "GitHub Action - Update docs version"
git checkout master
git add .
bsideup marked this conversation as resolved.
Show resolved Hide resolved
# Only commit and push if we have changes
git diff && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}")
bsideup marked this conversation as resolved.
Show resolved Hide resolved
- name: Push changes
uses: ad-m/github-push-action@68af9897f2b021035ca3952bf354bbb4675c1762 # v0.5.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}