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 the branch where
the job was triggered.

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

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

jobs:
build-linux:
if: github.repository_owner == 'ovn-org'
name: linux ${{ join(matrix.*, ' ') }}
container: fedora:latest
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,8 +32,9 @@ jobs:
- name: checkout ovn-website
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: 'ovn-website'
ref: 'main'
ref: ${{ github.ref }}

- name: checkout OVN
uses: actions/checkout@v4
Expand Down Expand Up @@ -76,24 +81,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 [ -n "$(git status --porcelain -unormal)" ]; 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 d3c5ea2

Please sign in to comment.