Merge pull request #548 from antmicro/umarcor/ci/reusable-workflow

ci: split Automerge and convert Doc to a reusable workflow
This commit is contained in:
Karol Gugala 2022-04-07 17:08:03 +02:00 committed by GitHub
commit d5a5b805ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 21 deletions

29
.github/workflows/Automerge.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Automerge
on:
pull_request:
push:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
Pipeline:
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
uses: ./.github/workflows/Doc.yml
Automerge:
needs: Pipeline
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
name: Automerge dependabot PRs
permissions:
contents: write
steps:
- name: Auto-merge Dependabot PR
run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash

View File

@ -1,17 +1,11 @@
name: Docs
on:
pull_request:
push:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
workflow_call:
jobs:
Docs:
if: ${{ !(github.event_name != 'pull_request' && github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
name: '📓 Docs'
steps:
@ -50,17 +44,3 @@ jobs:
git config --local user.name "GitHub Actions"
git commit -a -m "update ${{ github.sha }}"
git push -u origin +HEAD:gh-pages
Automerge:
needs: Docs
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
name: Automerge dependabot PRs
permissions:
contents: write
steps:
- name: Auto-merge Dependabot PR
run: GITHUB_TOKEN='${{ github.token }}' gh pr merge '${{ github.event.pull_request.html_url }}' --squash