Skip to content

Commit

Permalink
ci: Make the manage push automatical.
Browse files Browse the repository at this point in the history
Instead of creating pull request that need to be
merged, directly push the changes into main branch.

Signed-off-by: Ales Musil <[email protected]>
  • Loading branch information
almusil committed Aug 13, 2024
1 parent c5285cc commit cc0aac8
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/dist-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Rebuild dist-docs

on:
workflow_dispatch:
# Build every week on Monday 00:00
schedule:
- cron: '0 0 * * 1'

jobs:
build-linux:
Expand All @@ -10,16 +13,12 @@ jobs:
runs-on: ubuntu-22.04

strategy:
max-parallel: 1
fail-fast: false
matrix:
include:
- branch: main
- branch: branch-22.03
- branch: branch-22.12
- branch: branch-23.03
- branch: branch-23.06
- branch: branch-23.09
- branch: branch-24.03
- branch: branch-24.09

steps:
- name: install dependencies
Expand All @@ -28,6 +27,7 @@ jobs:
- name: checkout ovn-website
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: 'ovn-website'
ref: 'main'

Expand Down Expand Up @@ -76,24 +76,18 @@ jobs:
tar xzvf /tmp/dist-docs.tgz --strip-components=1 -C ${DOCS_DIR}
working-directory: ovn-website/src/static/support

- name: pull-request for updated dist-docs
id: pull_request
uses: peter-evans/create-pull-request@v6
with:
path: ovn-website
commit-message: |
dist-docs: Update OVN ${{ matrix.branch }} manpages
committer: github-actions <[email protected]>
author: github-actions <[email protected]>
branch: dist-docs-${{ matrix.branch }}
title: Pulling dist-docs from OVN ${{ matrix.branch }}
body: Automated changes to pull latest dist-docs from OVN ${{ matrix.branch }}

- name: pull-request info
if: ${{ success() }}
- name: push updated dist-docs
run: |
echo "Pull request number: ${{ steps.pull_request.outputs.pull-request-number }}"
echo "Pull request url: ${{ steps.pull_request.outputs.pull-request-url }}"
if ! git diff --quiet --exit-code; then
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add src/static/support
git commit -m "Update OVN ${{ matrix.branch }} manpages"
#git push
else
echo "No changes needed for ${{ matrix.branch }} manpages"
fi
working-directory: ovn-website

- name: copy logs on failure
if: failure() || cancelled()
Expand Down

0 comments on commit cc0aac8

Please sign in to comment.